From ab59abbf981c5cb18ed668153bcee943e61c4efb Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 23 Oct 2026 10:50:42 +0200 Subject: [PATCH] container: allow projects to skip QEMU setup step Not to break existing users of this template (like Icinga 2), it's on by default, any other project that want to skip this step must explicitly say so. --- .github/workflows/container-image.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index e7e2534..54a9d73 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -1,12 +1,13 @@ # The Build and Publish Container Image workflow builds container images and pushes them to both -# GitHub Container Registry (GHCR) and Docker Hub. It sets up QEMU and Docker Buildx for cross-platform -# builds, and builds the container images using the Containerfile. For all non-pull request events that -# trigger this workflow, it logs into GHCR and Docker Hub using credentials from the workflow call inputs, -# tags and pushes the images to both registries, and generates and pushes signed build provenance attestations -# to each registry. Additionally, when a building and publishing the latest tag, it syncs the README file -# determined by the container_readme_filepath input (or the For-Container.md file found in the ./doc/ directory -# if not provided) with Docker Hub. For pull request events, it just builds the images but does not push them -# to the registries. +# GitHub Container Registry (GHCR) and Docker Hub. It sets up QEMU conditionally based on the skip_qemu input, +# and Docker Buildx for cross-platform builds, and builds the container images using the Containerfile. +# +# For all non-pull request events that trigger this workflow, it logs into GHCR and Docker Hub using credentials +# from the workflow call inputs, tags and pushes the images to both registries, and generates and pushes signed +# build provenance attestations to each registry. Additionally, when a building and publishing the latest tag, +# it syncs the README file determined by the container_readme_filepath input (or the For-Container.md file found +# in the ./doc/ directory if not provided) with Docker Hub. For pull request events, it just builds the images but +# does not push them to the registries. name: Container Image @@ -25,6 +26,11 @@ on: required: false type: string description: 'Path to the README file to sync with Docker Hub. Defaults to the For-Container.md file in the ./doc/ directory.' + skip_qemu: + required: false + type: boolean + default: false + description: 'If true, skips the QEMU setup step. Only set this to true if the Containerfile cross-compiles for all target platforms without emulation.' # We do not need to require the secrets.GITHUB_TOKEN here because it is automatically # inherited from the workflow call [^1]. # @@ -136,6 +142,7 @@ jobs: type=raw,value=latest,enable=${{ env.LATEST }} - name: Set up QEMU + if: ${{ ! inputs.skip_qemu }} uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx