@@ -3,6 +3,11 @@ name: build
33on :
44 workflow_call :
55 inputs :
6+ output :
7+ type : string
8+ description : " Build output destination (one of cacheonly, registry, local)"
9+ default : ' cacheonly'
10+ required : false
611 cache :
712 type : boolean
813 description : " Enable cache to GitHub Actions cache backend"
7176 type : string
7277 description : " List of metadata for an image"
7378 required : false
74- build-output :
75- type : string
76- description : " Build output destination (one of cacheonly, registry, local)"
77- default : ' cacheonly'
78- required : false
7979 build-platforms :
8080 type : string
8181 description : " List of target platforms to build"
@@ -125,7 +125,7 @@ jobs:
125125 -
126126 name : Docker meta
127127 id : meta
128- if : ${{ inputs.build- output == 'registry' }}
128+ if : ${{ inputs.output == 'registry' }}
129129 uses : docker/metadata-action@v5
130130 with :
131131 images : ${{ inputs.meta-images }}
@@ -142,7 +142,7 @@ jobs:
142142 INPUT_CACHE : ${{ inputs.cache }}
143143 INPUT_CACHE-MODE : ${{ inputs.cache-mode }}
144144 INPUT_META-IMAGES : ${{ inputs.meta-images }}
145- INPUT_BUILD-OUTPUT : ${{ inputs.build- output }}
145+ INPUT_BUILD-OUTPUT : ${{ inputs.output }}
146146 INPUT_BUILD-ANNOTATIONS : ${{ inputs.build-annotations }}
147147 INPUT_SET-META-ANNOTATIONS : ${{ inputs.set-meta-annotations }}
148148 INPUT_META-ANNOTATIONS : ${{ steps.meta.outputs.annotations }}
@@ -211,7 +211,7 @@ jobs:
211211 buildkitd-flags : --debug
212212 -
213213 name : Login to registry
214- if : ${{ inputs.build- output == 'registry' }}
214+ if : ${{ inputs.output == 'registry' }}
215215 # TODO: switch to docker/login-action when OIDC is supported
216216 uses : crazy-max/docker-login-action@dockerhub-oidc
217217 with :
@@ -240,6 +240,7 @@ jobs:
240240 BUILDKIT_MULTI_PLATFORM : 1
241241 -
242242 name : Install @docker/actions-toolkit
243+ if : ${{ inputs.output != 'cacheonly' }}
243244 uses : actions/github-script@v8
244245 env :
245246 INPUT_DAT-MODULE : ${{ env.DOCKER_ACTIONS_TOOLKIT_MODULE }}
@@ -248,6 +249,7 @@ jobs:
248249 await exec.exec('npm', ['install', '--prefer-offline', '--no-audit', core.getInput('dat-module')]);
249250 -
250251 name : Install Cosign
252+ if : ${{ inputs.output != 'cacheonly' }}
251253 uses : actions/github-script@v8
252254 env :
253255 INPUT_COSIGN-VERSION : ${{ env.COSIGN_VERSION }}
@@ -264,7 +266,7 @@ jobs:
264266 await cosign.printVersion();
265267 -
266268 name : Signing attestation manifests
267- if : ${{ inputs.build- output == 'registry' }}
269+ if : ${{ inputs.output == 'registry' }}
268270 uses : actions/github-script@v8
269271 env :
270272 INPUT_IMAGE-NAMES : ${{ inputs.meta-images }}
@@ -288,7 +290,7 @@ jobs:
288290 );
289291 -
290292 name : Signing local artifacts
291- if : ${{ inputs.build- output == 'local' }}
293+ if : ${{ inputs.output == 'local' }}
292294 uses : actions/github-script@v8
293295 env :
294296 INPUT_LOCAL-OUTPUT-DIR : ${{ env.LOCAL_EXPORT_DIR }}
@@ -309,7 +311,7 @@ jobs:
309311 );
310312 -
311313 name : Create manifest
312- if : ${{ inputs.build- output == 'registry' }}
314+ if : ${{ inputs.output == 'registry' }}
313315 uses : actions/github-script@v8
314316 env :
315317 INPUT_IMAGE-NAMES : ${{ inputs.meta-images }}
@@ -333,12 +335,12 @@ jobs:
333335 }
334336 -
335337 name : List local output
336- if : ${{ inputs.build- output == 'local' }}
338+ if : ${{ inputs.output == 'local' }}
337339 run : |
338340 tree -nh ${{ env.LOCAL_EXPORT_DIR }}
339341 -
340342 name : Upload artifact
341- if : ${{ inputs.build- output == 'local' }}
343+ if : ${{ inputs.output == 'local' }}
342344 uses : actions/upload-artifact@v5
343345 with :
344346 name : docker-github-builder-assets
0 commit comments