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