ci: push the smoke-tested image instead of rebuilding it

The Push step ran the whole build again with no-cache, so the pushed
image was not the one that passed the smoke test.

Tag the image ID from the Build step and push it after the smoke test,
so exactly the tested image is published.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
pull/213/head
Josef Schlehofer 2026-09-14 13:48:29 +02:00
parent c414f04ac4
commit 6c0451b399
No known key found for this signature in database
GPG Key ID: 942FF3271E2AC7DB
1 changed files with 24 additions and 33 deletions

View File

@ -253,18 +253,14 @@ jobs:
- name: Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v7
with:
push: true
no-cache: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
DOWNLOAD_FILE=imagebuilder-.*x86_64.tar.[xz|zst]
VERSION_PATH=${{ needs.generate_matrix.outputs.version_path }}
TARGET=${{ matrix.target }}
FILE_HOST=${{ needs.generate_matrix.outputs.file_host }}
RUN_SETUP=${{ needs.generate_matrix.outputs.run_setup }}
env:
IMAGE_ID: ${{ steps.build.outputs.imageid }}
TAGS: ${{ steps.meta.outputs.tags }}
run: |
for tag in $TAGS; do
docker tag "$IMAGE_ID" "$tag"
docker push "$tag"
done
- name: Cleanup Docker containers
run: docker system prune -f
@ -405,23 +401,19 @@ jobs:
- name: Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v7
with:
push: true
no-cache: true
tags: |
env:
IMAGE_ID: ${{ steps.build.outputs.imageid }}
TAGS: |
${{ steps.meta_ref.outputs.tags }}
${{ steps.meta_version.outputs.tags }}
${{ steps.meta_master.outputs.tags }}
${{ steps.meta_target_arch.outputs.tags }}
${{ steps.meta_latest.outputs.tags }}
build-args: |
DOWNLOAD_FILE=sdk-.*.Linux-x86_64.tar.[xz|zst]
VERSION_PATH=${{ needs.generate_matrix.outputs.version_path }}
TARGET=${{ matrix.target }}
FILE_HOST=${{ needs.generate_matrix.outputs.file_host }}
RUN_SETUP=${{ needs.generate_matrix.outputs.run_setup }}
labels: ${{ steps.meta_ref.outputs.labels }}
run: |
for tag in $TAGS; do
docker tag "$IMAGE_ID" "$tag"
docker push "$tag"
done
- name: Cleanup Docker containers
run: docker system prune -f
@ -524,15 +516,14 @@ jobs:
- name: Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v7
with:
no-cache: true
push: true
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile.rootfs
build-args: ${{ steps.build_args.outputs.args }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/${{ matrix.arch }}
env:
IMAGE_ID: ${{ steps.build.outputs.imageid }}
TAGS: ${{ steps.meta.outputs.tags }}
run: |
for tag in $TAGS; do
docker tag "$IMAGE_ID" "$tag"
docker push "$tag"
done
- name: Cleanup Docker containers
run: docker system prune -f