File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,24 @@ jobs:
35
35
username : ${{ github.actor }}
36
36
password : ${{ secrets.GITHUB_TOKEN }}
37
37
38
+ # Extract version from tag if present
39
+ - name : Extract version from tag
40
+ id : tag_version
41
+ run : |
42
+ if [[ $GITHUB_REF == refs/tags/v* ]]; then
43
+ echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
44
+ echo "Using version tag: ${GITHUB_REF#refs/tags/}"
45
+ else
46
+ echo "VERSION=latest" >> $GITHUB_OUTPUT
47
+ echo "No version tag, using 'latest'"
48
+ fi
49
+
38
50
- uses : docker/build-push-action@v5
39
51
with :
40
52
context : .
41
53
platforms : linux/amd64,linux/arm64
42
54
push : ${{ github.event_name != 'pull_request' }}
43
55
tags : |
44
56
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
45
- ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
57
+ ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
58
+ ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.tag_version.outputs.VERSION }}
You can’t perform that action at this time.
0 commit comments