Skip to content

Commit 7f58f6d

Browse files
committed
Fix tagging image
1 parent 2982961 commit 7f58f6d

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

.github/workflows/build-image.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Build and push Docker image
22

33
on:
44
push:
5-
branches: [main]
65
tags: ["v*"]
76

87
permissions:
@@ -18,14 +17,9 @@ jobs:
1817
with:
1918
fetch-depth: 0
2019

21-
- name: Set VERSION from tag or branch
20+
- name: Set VERSION from tag
2221
id: version
23-
run: |
24-
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
25-
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
26-
else
27-
echo "version=main-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
28-
fi
22+
run: echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
2923

3024
- name: Log in to GHCR
3125
uses: docker/login-action@v3
@@ -43,13 +37,11 @@ jobs:
4337
with:
4438
images: ghcr.io/${{ github.repository }}
4539
tags: |
46-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
47-
type=sha,prefix=sha-,enable=${{ github.ref == 'refs/heads/main' }}
4840
type=semver,pattern={{version}}
4941
type=semver,pattern={{major}}.{{minor}}
5042
type=semver,pattern={{major}}
5143
type=ref,event=tag
52-
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
44+
type=raw,value=latest
5345
5446
- name: Build and push
5547
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)