Skip to content

Commit 1e6be63

Browse files
update
1 parent c28f3c5 commit 1e6be63

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

.github/workflows/build-intermediary-image.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ jobs:
2626
- linux/amd64
2727
- linux/arm64
2828
outputs:
29-
IMAGE_NAME: ${{ steps.image_builder.outputs.IMAGE }}
30-
TAGS: ${{ steps.meta.outputs.tags }}
31-
VERSION: ${{ steps.meta.outputs.version }}
29+
IMAGE_NAME: ${{ steps.vars.outputs.FULL_IMAGE }}
3230

3331
steps:
3432
- name: Checkout
3533
uses: actions/checkout@v4
3634

37-
- name: Prepare platform safe variable
35+
- name: Prepare platform-safe variable
36+
id: platform_vars
3837
run: |
39-
platform=${{ matrix.platform }}
40-
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
38+
echo "PLATFORM_PAIR=${{ matrix.platform }}" | tr '/' '-' >> $GITHUB_ENV
4139
4240
- name: Set image tag components
4341
id: vars
@@ -51,21 +49,6 @@ jobs:
5149
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_OUTPUT
5250
echo "FULL_IMAGE=$FULL_IMAGE" >> $GITHUB_OUTPUT
5351
54-
- name: Docker metadata
55-
id: meta
56-
uses: docker/metadata-action@v5
57-
with:
58-
images: ${{ env.REGISTRY_IMAGE }}
59-
tags: |
60-
${IMAGE_TAG}
61-
62-
- name: Image name builder
63-
id: image_builder
64-
run: |
65-
# We override default jq usage to pick our custom IMAGE_TAG
66-
IMAGE="${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.IMAGE_TAG }}"
67-
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT
68-
6952
- name: Set up QEMU
7053
uses: docker/setup-qemu-action@v3
7154

@@ -85,22 +68,21 @@ jobs:
8568
with:
8669
context: .
8770
platforms: ${{ matrix.platform }}
88-
push: false
89-
labels: ${{ steps.meta.outputs.labels }}
71+
push: true
9072
cache-from: type=gha
9173
cache-to: type=gha,mode=max
92-
outputs: type=image,name=${{ steps.image_builder.outputs.IMAGE }},push-by-digest=true,push=true
74+
outputs: type=image,name=${{ steps.vars.outputs.FULL_IMAGE }},push-by-digest=true
9375

9476
- name: Export digest
9577
run: |
9678
mkdir -p /tmp/digests
97-
echo "${{ steps.build.outputs.digest }}" > "/tmp/digests/${PLATFORM_PAIR}.txt"
79+
echo "${{ steps.build.outputs.digest }}" > "/tmp/digests/${{ env.PLATFORM_PAIR }}.txt"
9880
9981
- name: Upload digest
10082
uses: actions/upload-artifact@v4
10183
with:
10284
name: digests-${{ env.PLATFORM_PAIR }}
103-
path: /tmp/digests/*
85+
path: /tmp/digests/${{ env.PLATFORM_PAIR }}.txt
10486
if-no-files-found: error
10587
retention-days: 1
10688

@@ -128,9 +110,8 @@ jobs:
128110
- name: Create manifest list and push
129111
working-directory: /tmp/digests
130112
run: |
131-
# Compose manifest create arguments from digest files
132113
DIGEST_ARGS=""
133-
for file in digests-*.txt; do
114+
for file in *.txt; do
134115
digest=$(cat "$file")
135116
DIGEST_ARGS+=" ${{ needs.build.outputs.IMAGE_NAME }}@$digest"
136117
done

0 commit comments

Comments
 (0)