Skip to content

Commit a087ca4

Browse files
committed
Rename outputs in GH publish workflow
1 parent b882b6f commit a087ca4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/publish.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ jobs:
2626
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
2727
# Change all uppercase to lowercase
2828
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 }}"
3130
# 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//')
3332
# Use Docker `latest` tag convention
34-
[ "$VERSION" == "main" ] && VERSION=latest
33+
[ "$IMAGE_TAG" == "main" ] && IMAGE_TAG=latest
3534
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_OUTPUT
36-
echo VERSION=$VERSION >> $GITHUB_OUTPUT
35+
echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_OUTPUT
3736
3837
- name: Set up Docker Buildx
3938
uses: docker/setup-buildx-action@v3
@@ -50,7 +49,7 @@ jobs:
5049
with:
5150
context: .
5251
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 }}
5453
labels: runnumber=${{ github.run_id }}
5554
cache-from: type=gha
5655
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)