Skip to content

Commit 0c6cbfe

Browse files
authored
refactor(docker-build): add ability to disable cache (#59)
1 parent 39f8881 commit 0c6cbfe

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: .github/workflows/docker-build-push-multi-platform.yml

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ on:
3838
required: false
3939
type: boolean
4040
default: false
41+
build-cache:
42+
description: >-
43+
Use cache when building the image.
44+
required: false
45+
type: boolean
46+
default: true
4147
build-cache-key:
4248
description: >-
4349
An explicit key for a cache entry.
@@ -99,6 +105,7 @@ jobs:
99105
context: ${{ inputs.build-context }}
100106
file: ${{ inputs.build-file }}
101107
labels: ${{ steps.meta.outputs.labels }}
108+
no-cache: ${{ ! inputs.build-cache }}
102109
outputs: type=image,name=${{ inputs.registry-image }},push-by-digest=true,name-canonical=true,push=true
103110
platforms: ${{ matrix.builder.platform }}
104111
provenance: ${{ inputs.build-provenance }}

Diff for: .github/workflows/docker-build-push-multi-registry.yml

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ on:
3131
Path to the Dockerfile.
3232
type: string
3333
required: false
34+
build-cache:
35+
description: >-
36+
Use cache when building the image.
37+
required: false
38+
type: boolean
39+
default: true
3440
build-cache-key:
3541
description: >-
3642
An explicit key for a cache entry.
@@ -114,6 +120,7 @@ jobs:
114120
context: ${{ inputs.build-context }}
115121
file: ${{ inputs.build-file }}
116122
labels: ${{ steps.meta.outputs.labels }}
123+
no-cache: ${{ ! inputs.build-cache }}
117124
outputs: type=image,"name=${{ inputs.dockerhub-repo }},${{ inputs.quay-repo }}",push-by-digest=true,name-canonical=true,push=true
118125
platforms: ${{ matrix.builder.platform }}
119126
provenance: false

0 commit comments

Comments
 (0)