Skip to content

Commit 53f8769

Browse files
committed
chore: Update push-to-registry.yaml with tag patterns for branch and semver versions
1 parent 1322fd3 commit 53f8769

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/push-to-registry.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: push-to-registry
33
on:
44
push:
55
branches: ['main']
6+
tags: ['v*']
67

78
env:
89
REGISTRY: ghcr.io
@@ -33,13 +34,17 @@ jobs:
3334
uses: docker/metadata-action@v5
3435
with:
3536
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
tags: |
38+
type=ref,event=branch
39+
type=semver,pattern=v{{version}}
40+
type=semver,pattern=v{{major}}.{{minor}}
3641
3742
- name: Build and push Docker image
3843
id: push
3944
uses: docker/build-push-action@v5
4045
with:
4146
context: .
42-
push: true
47+
push: ${{ github.event_name != 'pull_request' }}
4348
tags: ${{ steps.meta.outputs.tags }}
4449
labels: ${{ steps.meta.outputs.labels }}
4550

0 commit comments

Comments
 (0)