Skip to content

Commit 4691867

Browse files
committed
🐛 [#697] Attempt fix push docker images
1 parent 14b7ec9 commit 4691867

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/build-image.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ jobs:
5555
# Strip git ref prefix from version
5656
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
5757
58-
# Strip "v" prefix from tag name (if present at all)
59-
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
60-
6158
# Use Docker `latest` tag convention
6259
[ "$VERSION" == "main" ] && VERSION=latest
6360

.github/workflows/ci.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,24 @@ jobs:
327327
steps:
328328
- uses: actions/checkout@v4
329329

330+
- name: Extract build args
331+
id: build-args
332+
run: |
333+
# Strip git ref prefix from version
334+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
335+
336+
# Use Docker `latest` tag convention
337+
[ "$VERSION" == "main" ] && VERSION=latest
338+
339+
# PRs result in version 'merge' -> transform that into 'latest'
340+
[ "$VERSION" == "merge" ] && VERSION=latest
341+
342+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
343+
330344
- name: Download built image
331345
uses: actions/download-artifact@v4
332346
with:
333-
name: docker-image-${{ needs.docker_build.outputs.version }}${{ matrix.target.image_tag_suffix }}
347+
name: docker-image-${{ steps.build-args.outputs.version }}${{ matrix.target.image_tag_suffix }}
334348

335349
- name: Load image
336350
run: |
@@ -342,4 +356,4 @@ jobs:
342356
--password-stdin
343357

344358
- name: Push the Docker image (production)
345-
run: docker push $IMAGE_NAME:${{ needs.docker_build.outputs.version }}${{ matrix.target.image_tag_suffix }}
359+
run: docker push $IMAGE_NAME:${{ steps.build-args.outputs.version }}${{ matrix.target.image_tag_suffix }}

0 commit comments

Comments
 (0)