From 9d617ab502a7a5b0011982051d96aed0fd2844d4 Mon Sep 17 00:00:00 2001 From: yurtemre7 Date: Mon, 26 Oct 2026 13:28:59 +0100 Subject: [PATCH] chore: add gha_cache flag to disable creation of caches --- .github/workflows/docker.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cfb165e..0bd01df 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -61,6 +61,11 @@ on: required: false default: ubuntu-latest type: string + gha_cache: + description: "Use the GitHub Actions cache for BuildKit layers and the QEMU binfmt image" + required: false + default: true + type: boolean jobs: docker: @@ -86,6 +91,8 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + cache-image: ${{ inputs.gha_cache }} - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 @@ -122,8 +129,8 @@ jobs: platforms: linux/${{ matrix.platform }} build-args: ${{ inputs.build_args }} file: ${{ inputs.file }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: ${{ inputs.gha_cache && 'type=gha' || '' }} + cache-to: ${{ inputs.gha_cache && 'type=gha,mode=max' || '' }} sbom: true outputs: type=image,name=${{ inputs.registry }}/${{ inputs.image_name }},push-by-digest=${{ inputs.push }},name-canonical=true,push=${{ inputs.push }}