Skip to content

Commit

Permalink
CI: Exclude preview releases from "latest" docker release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
binarybaron authored Jul 22, 2024
1 parent f24c11f commit eef78cd
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/build-release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,31 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set Docker tags
id: docker_tags
run: |
if [[ ${{ github.event.release.tag_name }} == "preview" ]]; then
echo "::set-output name=preview::true"
else
echo "::set-output name=preview::false"
fi
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.DOCKER_IMAGE_NAME }}:latest
${{ env.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}
${{ env.DOCKER_IMAGE_NAME }}:latest
if: steps.docker_tags.outputs.preview == 'false'

- name: Build and push Docker image without latest tag (preview release)
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}
if: steps.docker_tags.outputs.preview == 'true'

0 comments on commit eef78cd

Please sign in to comment.