File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,13 @@ jobs:
26
26
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
27
27
# Change all uppercase to lowercase
28
28
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
29
- # Strip git ref prefix from version
30
- VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
29
+ IMAGE_TAG="${{ github.ref_name }}"
31
30
# Strip "v" prefix from tag name
32
- [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION =$(echo $VERSION | sed -e 's/^v//')
31
+ [[ "${{ github.ref_type }}" == "tag" ]] && IMAGE_TAG =$(echo $IMAGE_TAG | sed -e 's/^v//')
33
32
# Use Docker `latest` tag convention
34
- [ "$VERSION " == "main" ] && VERSION =latest
33
+ [ "$IMAGE_TAG " == "main" ] && IMAGE_TAG =latest
35
34
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_OUTPUT
36
- echo VERSION=$VERSION >> $GITHUB_OUTPUT
35
+ echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_OUTPUT
37
36
38
37
- name : Set up Docker Buildx
39
38
uses : docker/setup-buildx-action@v3
50
49
with :
51
50
context : .
52
51
push : true
53
- tags : ${{ steps.vars.outputs.IMAGE_ID }}:${{ steps.vars.outputs.VERSION }}
52
+ tags : ${{ steps.vars.outputs.IMAGE_ID }}:${{ steps.vars.outputs.IMAGE_TAG }}
54
53
labels : runnumber=${{ github.run_id }}
55
54
cache-from : type=gha
56
55
cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments