Skip to content

Commit a082eb5

Browse files
committed
Fix trigger api tagging
1 parent c8806a9 commit a082eb5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/build-image.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build and push Docker image
33
on:
44
push:
55
tags: ["v*"]
6+
release:
7+
types: [published]
68

79
permissions:
810
contents: read
@@ -16,10 +18,16 @@ jobs:
1618
uses: actions/checkout@v4
1719
with:
1820
fetch-depth: 0
21+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
1922

2023
- name: Set VERSION from tag
2124
id: version
22-
run: echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
25+
run: |
26+
if [[ "${{ github.event_name }}" == "release" ]]; then
27+
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
28+
else
29+
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
30+
fi
2331
2432
- name: Log in to GHCR
2533
uses: docker/login-action@v3
@@ -37,6 +45,7 @@ jobs:
3745
with:
3846
images: ghcr.io/${{ github.repository }}
3947
tags: |
48+
type=raw,value=${{ steps.version.outputs.version }}
4049
type=semver,pattern={{version}}
4150
type=semver,pattern={{major}}.{{minor}}
4251
type=semver,pattern={{major}}

0 commit comments

Comments
 (0)