Skip to content

Commit 6ef6598

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

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
sbom: true
@@ -355,7 +344,6 @@ jobs:
355344
with:
356345
artifact-name: bake-nosign-output
357346
artifact-upload: true
358-
cache: true
359347
context: test
360348
output: local
361349
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"
@@ -370,23 +356,23 @@ jobs:
370356
name: Set up QEMU
371357
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
372358
if: ${{ inputs.setup-qemu }}
359+
with:
360+
cache-image: false
373361
-
374362
name: Set up Docker Buildx
375363
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
376364
with:
377365
version: ${{ env.BUILDX_VERSION }}
378366
buildkitd-flags: --debug
379367
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
368+
cache-binary: false
380369
-
381370
name: Prepare
382371
id: prepare
383372
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
384373
env:
385374
INPUT_PLATFORM: ${{ matrix.platform }}
386375
INPUT_LOCAL-EXPORT-DIR: ${{ env.LOCAL_EXPORT_DIR }}
387-
INPUT_CACHE: ${{ inputs.cache }}
388-
INPUT_CACHE-SCOPE: ${{ inputs.cache-scope }}
389-
INPUT_CACHE-MODE: ${{ inputs.cache-mode }}
390376
INPUT_CONTEXT: ${{ inputs.context }}
391377
INPUT_FILES: ${{ inputs.files }}
392378
INPUT_OUTPUT: ${{ inputs.output }}
@@ -414,9 +400,6 @@ jobs:
414400
415401
const inpLocalExportDir = core.getInput('local-export-dir');
416402
417-
const inpCache = core.getBooleanInput('cache');
418-
const inpCacheScope = core.getInput('cache-scope');
419-
const inpCacheMode = core.getInput('cache-mode');
420403
const inpContext = core.getInput('context');
421404
const inpFiles = Util.getInputList('files');
422405
const inpOutput = core.getInput('output');
@@ -514,10 +497,6 @@ jobs:
514497
if (inpPlatform) {
515498
bakeOverrides.push(`*.platform=${inpPlatform}`);
516499
}
517-
if (inpCache) {
518-
bakeOverrides.push(`*.cache-from=type=gha,scope=${inpCacheScope || target}${platformPairSuffix}`);
519-
bakeOverrides.push(`*.cache-to=type=gha,scope=${inpCacheScope || target}${platformPairSuffix},mode=${inpCacheMode}`);
520-
}
521500
core.info(JSON.stringify(bakeOverrides, null, 2));
522501
core.setOutput('overrides', bakeOverrides.join(os.EOL));
523502
});
@@ -567,7 +546,7 @@ jobs:
567546
const { Install } = require('@docker/actions-toolkit/lib/cosign/install');
568547
569548
const cosignInstall = new Install();
570-
const cosignBinPath = await cosignInstall.download(core.getInput('cosign-version'), false, true);
549+
const cosignBinPath = await cosignInstall.download(core.getInput('cosign-version'), true, true);
571550
await cosignInstall.install(cosignBinPath);
572551
573552
const cosign = new Cosign();
@@ -733,6 +712,7 @@ jobs:
733712
version: ${{ env.BUILDX_VERSION }}
734713
buildkitd-flags: --debug
735714
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
715+
cache-binary: false
736716
-
737717
name: Create manifest
738718
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)