File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ name: Build and push Docker image
22
33on :
44 push :
5- branches : [main]
65 tags : ["v*"]
76
87permissions :
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
You can’t perform that action at this time.
0 commit comments