Skip to content

Commit fd79ac2

Browse files
committed
RTFM
1 parent 5b281ba commit fd79ac2

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,13 @@ jobs:
5959

6060
# Extract metadata (tags, labels) for Docker
6161
# https://github.com/docker/metadata-action
62-
- name: Extract Docker metadata for PR
62+
- name: Extract Docker metadata
6363
id: meta
64-
if: github.event_name == 'pull_request'
6564
uses: docker/metadata-action@v5
6665
with:
6766
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
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 }}"
67+
tags: |
68+
${{ github.event_name == 'pull_request' && 'type=ref,event=pr' || 'type=sha' }}
8069
8170
# Build and push Docker image with Buildx
8271
# https://github.com/docker/build-push-action

0 commit comments

Comments
 (0)