Skip to content

Commit 70fec0c

Browse files
committed
bake: remove gha cache
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent ab6425c commit 70fec0c

File tree

3 files changed

+5
-40
lines changed

3 files changed

+5
-40
lines changed

.github/workflows/.test-bake.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
contents: read
3030
id-token: write
3131
with:
32-
cache: true
33-
cache-scope: bake-aws
3432
context: test
3533
output: image
3634
push: ${{ github.event_name != 'pull_request' }}
@@ -80,8 +78,6 @@ jobs:
8078
contents: read
8179
id-token: write
8280
with:
83-
cache: true
84-
cache-scope: bake-aws
8581
context: test
8682
output: image
8783
push: ${{ github.event_name != 'pull_request' }}
@@ -131,8 +127,6 @@ jobs:
131127
contents: read
132128
id-token: write
133129
with:
134-
cache: true
135-
cache-scope: bake-aws-nosign
136130
context: test
137131
output: image
138132
push: ${{ github.event_name != 'pull_request' }}
@@ -184,8 +178,6 @@ jobs:
184178
id-token: write
185179
packages: write
186180
with:
187-
cache: true
188-
cache-scope: bake-aws
189181
context: test
190182
output: image
191183
push: ${{ github.event_name != 'pull_request' }}
@@ -244,7 +236,6 @@ jobs:
244236
with:
245237
artifact-name: bake-output
246238
artifact-upload: true
247-
cache: true
248239
context: test
249240
output: local
250241
sbom: true
@@ -282,7 +273,6 @@ jobs:
282273
with:
283274
artifact-name: bake-single-output
284275
artifact-upload: true
285-
cache: true
286276
context: test
287277
output: local
288278
sbom: true
@@ -319,7 +309,6 @@ jobs:
319309
id-token: write
320310
with:
321311
artifact-upload: false
322-
cache: true
323312
context: test
324313
output: local
325314
push: ${{ github.event_name != 'pull_request' }}
@@ -356,7 +345,6 @@ jobs:
356345
with:
357346
artifact-name: bake-nosign-output
358347
artifact-upload: true
359-
cache: true
360348
context: test
361349
output: local
362350
sbom: true

.github/workflows/bake.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@ on:
2727
type: string
2828
description: "Environment variables to inject in the reusable workflow as list of key-value pair. This is similar to the GitHub Actions env context that is currently not available when calling a reusable workflow"
2929
required: false
30-
cache:
31-
type: boolean
32-
description: "Enable cache to GitHub Actions cache backend"
33-
required: false
34-
default: false
35-
cache-scope:
36-
type: string
37-
description: "Which scope cache object belongs to if cache enabled (defaults to target name)"
38-
required: false
39-
cache-mode:
40-
type: string
41-
description: "Cache layers to export if cache enabled (min or max)"
42-
required: false
43-
default: 'min'
4430
context:
4531
type: string
4632
description: "Context to build from in the Git working tree"
@@ -362,23 +348,23 @@ jobs:
362348
name: Set up QEMU
363349
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
364350
if: ${{ inputs.setup-qemu }}
351+
with:
352+
cache-image: false
365353
-
366354
name: Set up Docker Buildx
367355
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
368356
with:
369357
version: ${{ env.BUILDX_VERSION }}
370358
buildkitd-flags: --debug
371359
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
360+
cache-binary: false
372361
-
373362
name: Prepare
374363
id: prepare
375364
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
376365
env:
377366
INPUT_PLATFORM: ${{ matrix.platform }}
378367
INPUT_LOCAL-EXPORT-DIR: ${{ env.LOCAL_EXPORT_DIR }}
379-
INPUT_CACHE: ${{ inputs.cache }}
380-
INPUT_CACHE-SCOPE: ${{ inputs.cache-scope }}
381-
INPUT_CACHE-MODE: ${{ inputs.cache-mode }}
382368
INPUT_CONTEXT: ${{ inputs.context }}
383369
INPUT_FILES: ${{ inputs.files }}
384370
INPUT_OUTPUT: ${{ inputs.output }}
@@ -406,9 +392,6 @@ jobs:
406392
407393
const inpLocalExportDir = core.getInput('local-export-dir');
408394
409-
const inpCache = core.getBooleanInput('cache');
410-
const inpCacheScope = core.getInput('cache-scope');
411-
const inpCacheMode = core.getInput('cache-mode');
412395
const inpContext = core.getInput('context');
413396
const inpFiles = Util.getInputList('files');
414397
const inpOutput = core.getInput('output');
@@ -506,10 +489,6 @@ jobs:
506489
if (inpPlatform) {
507490
bakeOverrides.push(`*.platform=${inpPlatform}`);
508491
}
509-
if (inpCache) {
510-
bakeOverrides.push(`*.cache-from=type=gha,scope=${inpCacheScope || target}${platformPairSuffix}`);
511-
bakeOverrides.push(`*.cache-to=type=gha,scope=${inpCacheScope || target}${platformPairSuffix},mode=${inpCacheMode}`);
512-
}
513492
core.info(JSON.stringify(bakeOverrides, null, 2));
514493
core.setOutput('overrides', bakeOverrides.join(os.EOL));
515494
});
@@ -559,7 +538,7 @@ jobs:
559538
const { Install } = require('@docker/actions-toolkit/lib/cosign/install');
560539
561540
const cosignInstall = new Install();
562-
const cosignBinPath = await cosignInstall.download(core.getInput('cosign-version'), false, true);
541+
const cosignBinPath = await cosignInstall.download(core.getInput('cosign-version'), true, true);
563542
await cosignInstall.install(cosignBinPath);
564543
565544
const cosign = new Cosign();
@@ -725,6 +704,7 @@ jobs:
725704
version: ${{ env.BUILDX_VERSION }}
726705
buildkitd-flags: --debug
727706
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
707+
cache-binary: false
728708
-
729709
name: Create manifest
730710
if: ${{ inputs.output == 'image' }}

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,6 @@ on:
331331
| `artifact-name` | String | `docker-github-builder-assets` | Name of the uploaded GitHub artifact (for `local` output) |
332332
| `artifact-upload` | Bool | `false` | Upload build output GitHub artifact (for `local` output) |
333333
| `envs` | List | | Environment variables to inject in the reusable workflow as list of key-value pair. This is similar to the [GitHub Actions `env` context](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#env-context) that is currently not available when calling a reusable workflow |
334-
| `cache` | Bool | `false` | Enable [GitHub Actions cache](https://docs.docker.com/build/cache/backends/gha/) exporter |
335-
| `cache-scope` | String | target name or `buildkit` | Which [scope cache object belongs to](https://docs.docker.com/build/cache/backends/gha/#scope) if `cache` is enabled. This is the cache blob prefix name used when pushing cache to GitHub Actions cache backend |
336-
| `cache-mode` | String | `min` | [Cache layers to export](https://docs.docker.com/build/cache/backends/#cache-mode) if cache enabled (`min` or `max`). In `min` cache mode, only layers that are exported into the resulting image are cached, while in `max` cache mode, all layers are cached, even those of intermediate steps |
337334
| `context` | String | `.` | Context to build from in the Git working tree |
338335
| `files` | List | `{context}/docker-bake.hcl` | List of bake definition files |
339336
| `output` | String | | Build output destination (one of [`image`](https://docs.docker.com/build/exporters/image-registry/) or [`local`](https://docs.docker.com/build/exporters/local-tar/)). |

0 commit comments

Comments
 (0)