From 6c0451b3998c46bb5a1b972b5b0d2d948aa14c83 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Mon, 14 Sep 2026 13:48:29 +0200 Subject: [PATCH] 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 --- .github/workflows/containers.yml | 57 ++++++++++++++------------------ 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index e6d24e6..94a1b71 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -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