Skip to content

Commit

Permalink
fix flag name on github release check
Browse files Browse the repository at this point in the history
  • Loading branch information
jafow committed Oct 18, 2020
1 parent 66ea1d8 commit d0f9793
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/backend-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,19 @@ jobs:
outputs:
sha: ${{ steps.contextvals.outputs.sha }}
built_at: ${{ steps.contextvals.outputs.built_at }}
is_github_release: ${{ steps.contextvals.outputs.is_release }}
is_dev_deploy: ${{ github.ref == 'master' }}
steps:
- name: Export values
id: contextvals
run: |
SHA=${{ github.sha }}
BUILT_AT=$(date "+%Y-%m-%d %H:%M:%S%z")
IS_GITHUB_RELEASE=${{ github.event_name == 'release' }}
echo ::set-output name=sha::${SHA:0:8}
echo ::set-output name=built_at::${BUILT_AT}
echo ::set-output name=is_release::${IS_GITHUB_RELEASE}
build:
# we do not rebuild on a release to production rather we just publish the built image at the git SHA we are releaseing from
if: ${{ github.event != 'release' }}
if: github.event_name != 'release'
needs: whatisthecontext
runs-on: ubuntu-latest
name: build & push image
Expand Down Expand Up @@ -81,7 +78,7 @@ jobs:
name: deploy to dev environment
runs-on: ubuntu-latest
needs: [whatisthecontext, build]
if: ${{ needs.whatisthecontext.outputs.is_release == false && needs.whatisthecontext.outputs.is_dev_deploy }}
if: ${{ github.event_name != 'release' && needs.whatisthecontext.outputs.is_dev_deploy }}
steps:

- name: Configure AWS credentials
Expand Down Expand Up @@ -116,7 +113,7 @@ jobs:
name: deploy to the production environment
runs-on: ubuntu-latest
needs: [whatisthecontext]
if: ${{ needs.whatisthecontext.outputs.is_release == true }}
if: ${{ github.event_name == 'release' }}
steps:

- name: Configure AWS credentials
Expand Down

0 comments on commit d0f9793

Please sign in to comment.