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:
67 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}67 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68 # Release version tag if the workflow is triggered by a release68 # Release version tag if the workflow is triggered by a release
69 # Branch name tag if the workflow is triggered by a push69 # 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
70 tags: |71 tags: |
71 ${{ github.event_name == 'release' && github.ref_name || env.BRANCH_NAME }}72 ${{ github.event_name == 'release' && github.ref_name || env.BRANCH_NAME }}
73 ${{ github.event_name == 'push' && env.BRANCH_NAME == 'release' && 'latest' || '' }}
7274
73 # Login into package repository as the person who created the release75 # Login into package repository as the person who created the release
74 - name: Log in to the Container registry76 - name: Log in to the Container registry
@@ -90,11 +92,3 @@ jobs:
90 push: true92 push: true
91 tags: ${{ steps.metadata.outputs.tags }}93 tags: ${{ steps.metadata.outputs.tags }}
92 labels: ${{ steps.metadata.outputs.labels }}94 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