@@ -6,31 +6,6 @@ name: Docker build images
66
77on : # yamllint disable-line rule:truthy
88 workflow_call :
9- outputs :
10- built-images :
11- description : |
12- Built images data.
13- Example:
14- ```json
15- {
16- "application": {
17- "name": "application",
18- "registry": "ghcr.io",
19- "repository": "my-org/my-repo/application",
20- "tags": ["pr-63-5222075","pr-63"],
21- "images": [
22- "ghcr.io/my-org/my-repo/application:pr-63-5222075@sha256:d31aa93410434ac9dcfc9179cac2cb1fd4d7c27f11527addc40299c7c675f49d",
23- "ghcr.io/my-org/my-repo/application:pr-63@sha256:d31aa93410434ac9dcfc9179cac2cb1fd4d7c27f11527addc40299c7c675f49d"
24- ],
25- "digest": "sha256:d31aa93410434ac9dcfc9179cac2cb1fd4d7c27f11527addc40299c7c675f49d",
26- "annotations": {
27- "org.opencontainers.image.created": "2021-09-30T14:00:00Z",
28- "org.opencontainers.image.description": "Application image"
29- }
30- }
31- }
32- ```
33- value : ${{ jobs.publish-manifests.outputs.built-images }}
349 inputs :
3510 runs-on :
3611 description : |
@@ -141,6 +116,32 @@ on: # yamllint disable-line rule:truthy
141116 GitHub App private key to generate GitHub token to be passed as build secret env.
142117 See https://github.com/actions/create-github-app-token.
143118 required : false
119+ outputs :
120+ built-images :
121+ description : |
122+ Built images data.
123+ Example:
124+ ```json
125+ {
126+ "application": {
127+ "name": "application",
128+ "registry": "ghcr.io",
129+ "repository": "my-org/my-repo/application",
130+ "tags": ["pr-63-5222075","pr-63"],
131+ "images": [
132+ "ghcr.io/my-org/my-repo/application:pr-63-5222075@sha256:d31aa93410434ac9dcfc9179cac2cb1fd4d7c27f11527addc40299c7c675f49d",
133+ "ghcr.io/my-org/my-repo/application:pr-63@sha256:d31aa93410434ac9dcfc9179cac2cb1fd4d7c27f11527addc40299c7c675f49d"
134+ ],
135+ "digest": "sha256:d31aa93410434ac9dcfc9179cac2cb1fd4d7c27f11527addc40299c7c675f49d",
136+ "annotations": {
137+ "org.opencontainers.image.created": "2021-09-30T14:00:00Z",
138+ "org.opencontainers.image.description": "Application image"
139+ },
140+ "platforms": ["linux/amd64", "linux/arm64"]
141+ }
142+ }
143+ ```
144+ value : ${{ jobs.publish-manifests.outputs.built-images }}
144145
145146permissions :
146147 contents : read
@@ -474,15 +475,17 @@ jobs:
474475 // Group by image name
475476 const images = {};
476477 builtImages.forEach(builtImage => {
477- const { name, image, ...rest } = builtImage;
478+ const { name, image, platform, ...rest } = builtImage;
478479 if (!images[name]) {
479480 images[name] = {
480481 name,
481482 images: [image],
483+ platforms: [platform],
482484 ...rest,
483485 };
484486 } else {
485487 images[name].images = [...new Set([...images[name].images, image])];
488+ images[name].platforms = [...new Set([...images[name].platforms, platform])];
486489 }
487490 });
488491
@@ -503,15 +506,16 @@ jobs:
503506 echo "self-workflow" >> .gitignore
504507 echo "self-workflow" >> .dockerignore
505508
506- - id : create-images-manifests
507- uses : ./self-workflow/actions/docker/create-images-manifests
508- with :
509- oci-registry : ${{ inputs.oci-registry }}
510- oci-registry-username : ${{ inputs.oci-registry-username }}
511- oci-registry-password : ${{ secrets.oci-registry-password }}
512- built-images : ${{ steps.built-images.outputs.built-images }}
509+ # - id: create-images-manifests
510+ # uses: ./self-workflow/actions/docker/create-images-manifests
511+ # with:
512+ # oci-registry: ${{ inputs.oci-registry }}
513+ # oci-registry-username: ${{ inputs.oci-registry-username }}
514+ # oci-registry-password: ${{ secrets.oci-registry-password }}
515+ # built-images: ${{ steps.built-images.outputs.built-images }}
513516
514517 - id : get-images-to-sign
518+ if : inputs.sign
515519 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
516520 with :
517521 script : |
@@ -527,7 +531,7 @@ jobs:
527531 const imagesToSign = Object.values(builtImages).map(image => image.images).flat();
528532 core.setOutput('images-to-sign', JSON.stringify(imagesToSign));
529533 - uses : ./self-workflow/actions/docker/sign-images
530- if : inputs. sign
534+ if : steps.get-images-to-sign.outputs.images-to- sign
531535 with :
532536 images : ${{ steps.get-images-to-sign.outputs.images-to-sign }}
533537 github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments