CI: Exclude preview releases from "latest" docker release tag

pull/1730/head
binarybaron 3 months ago committed by GitHub
parent f24c11f0a3
commit eef78cddb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -145,6 +145,15 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} 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 - name: Build and push Docker image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
@ -152,5 +161,15 @@ jobs:
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: | tags: |
${{ env.DOCKER_IMAGE_NAME }}:latest
${{ env.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }} ${{ 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'

Loading…
Cancel
Save