Update latest tag for release branch pushes

1d32749ed26a6d2916f5b1b98380019c50215d0b

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -8Showing whitespace changes
.github/workflows/docker-publish.yml+2 -8
@@ -67,8 +67,10 @@ jobs:
6767 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6868 # Release version tag if the workflow is triggered by a release
6969 # Branch name tag if the workflow is triggered by a push
70+ # Latest tag if the branch is release and the workflow is triggered by a push
7071 tags: |
7172 ${{ github.event_name == 'release' && github.ref_name || env.BRANCH_NAME }}
73+ ${{ github.event_name == 'push' && env.BRANCH_NAME == 'release' && 'latest' || '' }}
7274
7375 # Login into package repository as the person who created the release
7476 - name: Log in to the Container registry
@@ -90,11 +92,3 @@ jobs:
9092 push: true
9193 tags: ${{ steps.metadata.outputs.tags }}
9294 labels: ${{ steps.metadata.outputs.labels }}
93-
94- # If the workflow is triggered by a release, marks and push the image as such
95- - name: Docker tag latest and push
96- if: ${{ github.event_name == 'release' }}
97- run: |
98- docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
99- docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
100- docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest