@@ -56,10 +56,22 @@ jobs:
5656 run : |
5757 echo "registry=$(echo '${{ steps.build-meta.outputs.tags }}' | cut -f1 -d:)" | tee -a "$GITHUB_OUTPUT"
5858
59+ - id : set_build_url
60+ name : Set BUILD_URL
61+ run : |
62+ echo "build_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | tee -a "$GITHUB_OUTPUT"
63+
5964 - id : build
6065 name : Build/push the arch-specific image
6166 uses : docker/build-push-action@v6
6267 with :
68+ platforms : ${{ matrix.platform }}
69+ build-args : |
70+ BUILD_TIMESTAMP=${{ github.event.repository.updated_at }}
71+ BUILD_URL=${{ steps.set_build_url.outputs.build_url }}
72+ GIT_REF_NAME=${{ github.ref_name }}
73+ GIT_SHA=${{ github.sha }}
74+ GIT_REPOSITORY_URL=${{ github.repositoryUrl }}
6375 cache-from : type=registry,ref=${{ steps.cache-meta.outputs.tags }}
6476 cache-to : type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
6577 labels : ${{ steps.build-meta.outputs.labels }}
@@ -74,13 +86,15 @@ jobs:
7486 echo "image-${RUNNER_ARCH,,}=${{ steps.get-registry.outputs.registry }}@${{ steps.build.outputs.digest }}" | tee -a "$GITHUB_OUTPUT"
7587
7688 merge :
77- runs-on : ubuntu-24.04
89+ runs-on : ubuntu-latest
7890 needs : build
7991 env :
8092 DOCKER_APP_IMAGE_ARM64 : ${{ needs.build.outputs.image-arm64 }}
8193 DOCKER_APP_IMAGE_X64 : ${{ needs.build.outputs.image-x64 }}
8294 outputs :
8395 image : ${{ steps.meta.outputs.tags }}
96+ build-image-arm : ${{ needs.build.outputs.image-arm64 }}
97+ build-image-x64 : ${{ needs.build.outputs.image-x64 }}
8498 steps :
8599 - name : Checkout code
86100 uses : actions/checkout@v4
@@ -109,7 +123,7 @@ jobs:
109123 "$DOCKER_APP_IMAGE_ARM64" "$DOCKER_APP_IMAGE_X64"
110124
111125 test :
112- runs-on : ubuntu-24.04
126+ runs-on : ubuntu-latest
113127 needs : merge
114128 env :
115129 COMPOSE_FILE : docker-compose.yml:docker-compose.ci.yml
@@ -157,17 +171,19 @@ jobs:
157171 if : ${{ always() }}
158172 uses : actions/upload-artifact@v4
159173 with :
160- name : Build Report (${{ github.run_id }}_${{ github.run_attempt }})
174+ name : UCBEARS Test Report (${{ github.run_id }}_${{ github.run_attempt }})
161175 path : artifacts/*
162176 if-no-files-found : error
163177
164178 push :
165- runs-on : ubuntu-24.04
179+ runs-on : ubuntu-latest
166180 needs :
167181 - merge
168182 - test
169183 env :
170184 DOCKER_APP_IMAGE : ${{ needs.merge.outputs.image }}
185+ DOCKER_APP_IMAGE_ARM64 : ${{ needs.merge.outputs.build-image-arm }}
186+ DOCKER_APP_IMAGE_X64 : ${{ needs.merge.outputs.build-image-x64 }}
171187 steps :
172188 - name : Checkout code
173189 uses : actions/checkout@v4
@@ -190,6 +206,6 @@ jobs:
190206
191207 - name : Retag and push the image
192208 run : |
193- docker pull "$DOCKER_APP_IMAGE"
194- echo "$DOCKER_METADATA_OUTPUT_TAGS" | tr ' ' '\n' | xargs -n1 docker tag "$DOCKER_APP_IMAGE"
195- docker push --all-tags "$(echo "$DOCKER_APP_IMAGE" | cut -f1 -d:)"
209+ docker buildx imagetools create \
210+ $(jq -cr '.tags | map("--tag " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
211+ $DOCKER_APP_IMAGE_ARM64 $DOCKER_APP_IMAGE_X64
0 commit comments