File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,13 +59,24 @@ jobs:
5959
6060 # Extract metadata (tags, labels) for Docker
6161 # https://github.com/docker/metadata-action
62- - name : Extract Docker metadata
62+ - name : Extract Docker metadata for PR
6363 id : meta
64+ if : github.event_name == 'pull_request'
6465 uses : docker/metadata-action@v5
6566 with :
6667 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67- tags : |
68- ${{ github.event_name == 'pull_request' ? 'pr-' + github.event.pull_request.number : steps.meta.outputs.tags }}
68+ tags :
69+ " pr-${{ github.event.pull_request.number }}"
70+
71+ - name : Extract Docker metadata for push
72+ id : meta
73+ if : github.event_name == 'push'
74+ uses : docker/metadata-action@v5
75+ with :
76+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
77+ tags :
78+ " latest"
79+ " ${{ github.sha }}"
6980
7081 # Build and push Docker image with Buildx
7182 # https://github.com/docker/build-push-action
You can’t perform that action at this time.
0 commit comments