Skip to content

Commit 47a7539

Browse files
committed
Fix tagging of new containers
1 parent 643c68c commit 47a7539

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/build-and-push.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: Build and push
22

33
on:
44
push:
5+
branches:
6+
- master
7+
tags:
8+
- v*
9+
pull_request:
10+
branches:
11+
- master
512

613
env:
714
REGISTRY: ghcr.io
@@ -28,18 +35,19 @@ jobs:
2835
username: ${{ github.actor }}
2936
password: ${{ secrets.GITHUB_TOKEN }}
3037

38+
# generate tags and labels for the Docker image
39+
# should contain the commit SHA, the branch name, and a tag if the commit is tagged, and latest
3140
- name: Docker metadata
3241
uses: docker/metadata-action@v5
3342
id: meta
3443
with:
3544
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3645
tags: |
37-
type=sha,format=long
3846
type=ref,event=branch
39-
type=ref,event=tag
40-
type=semver,pattern=v[0-9]+.[0-9]+.[0-9]+
41-
flavor: |
42-
latest=auto
47+
type=ref,event=pr
48+
type=sha,format=long,prefix=
49+
type=semver,pattern={{version}}
50+
type=semver,pattern={{major}}.{{minor}}
4351
4452
- name: Setup Go
4553
uses: actions/setup-go@v5

0 commit comments

Comments
 (0)