Skip to content

Commit

Permalink
Merge pull request #272 from kjsanger/feature/conditional-deploy
Browse files Browse the repository at this point in the history
Make image deployment conditional on release
  • Loading branch information
kjsanger committed Apr 19, 2023
2 parents 400a492 + 26fdfd0 commit a3c9c5b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,32 @@ jobs:
removeArtifacts: true
artifactErrorsFailBuild: true
generateReleaseNotes: true

outputs:
isRelease: ${{ github.sha == env.MASTER_SHA }}

deploy:
runs-on: ubuntu-latest

needs: [build, release]

# Workaround for https://github.com/actions/runner/issues/1483
# Actions coerces boolean to string
if: needs.release.outputs.isRelease == 'true'

steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Fetch Tags"
# Workaround for https://github.com/actions/checkout/issues/290
run: |
# Avoid git exiting when Actions runs
git config --global --add safe.directory "$PWD"
git fetch --tags --force
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
Expand Down

0 comments on commit a3c9c5b

Please sign in to comment.