Skip to content

Commit

Permalink
conditionally set docker tag -- testing only
Browse files Browse the repository at this point in the history
  • Loading branch information
Nina Bernick committed Jul 26, 2024
1 parent 5ef8b0a commit 0b0de7a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ jobs:
release-type: simple
token: ${{ secrets.GITHUB_TOKEN }}

- name: Print version
run: echo "Calculated version is ${{ steps.release.outputs.version }}"
- name: Determine Docker tag
id: docker_tag
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "::set-output name=tag::${{ steps.release.outputs.version }}"
else
echo "::set-output name=tag::latest"
fi
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}-test:latest
ghcr.io/${{ github.repository }}-test:${{ steps.release.outputs.version }}
ghcr.io/${{ github.repository }}-test:${{ steps.docker_tag.outputs.version }}

0 comments on commit 0b0de7a

Please sign in to comment.