Skip to content

Commit 5b66e9d

Browse files
committed
build/bake: allow disabling build summaries
Add a build-summary input that defaults to true and sets DOCKER_BUILD_SUMMARY in the build job environment. Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent ef01f66 commit 5b66e9d

5 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎.github/workflows/.test-bake.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ jobs:
414414
id-token: write
415415
with:
416416
artifact-upload: false
417+
build-summary: false
417418
context: test
418419
output: local
419420
sbom: true

‎.github/workflows/.test-build.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ jobs:
460460
id-token: write
461461
with:
462462
artifact-upload: false
463+
build-summary: false
463464
file: test/hello.Dockerfile
464465
output: local
465466
platforms: linux/amd64,linux/arm64

‎.github/workflows/bake.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ on:
4545
description: "Duration after which artifact will expire in days. 0 means using default retention."
4646
required: false
4747
default: 0
48+
build-summary:
49+
type: boolean
50+
description: "Generate a build summary"
51+
required: false
52+
default: true
4853
cache:
4954
type: boolean
5055
description: "Enable cache to GitHub Actions cache backend"
@@ -522,6 +527,7 @@ jobs:
522527
- registry-identities
523528
- prepare
524529
env:
530+
DOCKER_BUILD_SUMMARY: ${{ inputs.build-summary }}
525531
REGISTRY_AUTHS_PRESENT: ${{ secrets.registry-auths != '' }}
526532
strategy:
527533
fail-fast: ${{ inputs.fail-fast }}

‎.github/workflows/build.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ on:
4545
description: "Duration after which artifact will expire in days. 0 means using default retention."
4646
required: false
4747
default: 0
48+
build-summary:
49+
type: boolean
50+
description: "Generate a build summary"
51+
required: false
52+
default: true
4853
annotations:
4954
type: string
5055
description: "List of annotations to set to the image"
@@ -450,6 +455,7 @@ jobs:
450455
- registry-identities
451456
- prepare
452457
env:
458+
DOCKER_BUILD_SUMMARY: ${{ inputs.build-summary }}
453459
REGISTRY_AUTHS_PRESENT: ${{ secrets.registry-auths != '' }}
454460
strategy:
455461
fail-fast: ${{ inputs.fail-fast }}

‎README.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ jobs:
233233
| `artifact-name` | String | `docker-github-builder-assets` | Name of the uploaded GitHub artifact (for `local` output) |
234234
| `artifact-upload` | Bool | `false` | Upload build output GitHub artifact (for `local` output) |
235235
| `artifact-retention-days` | Number | `0` | Duration after which artifact will expire in days. `0` means using default retention |
236+
| `build-summary` | Bool | `true` | Generate a [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) |
236237
| `annotations` | List | | List of annotations to set to the image (for `image` output) |
237238
| `build-args` | List | `auto` | List of [build-time variables](https://docs.docker.com/engine/reference/commandline/buildx_build/#build-arg). If you want to set a build-arg through an environment variable, use the `envs` input |
238239
| `cache` | Bool | `false` | Enable [GitHub Actions cache](https://docs.docker.com/build/cache/backends/gha/) exporter |
@@ -262,11 +263,11 @@ jobs:
262263

263264
### Secrets
264265

265-
| Name | Default | Description |
266-
|------------------|-----------------------|--------------------------------------------------------------------------------|
267-
| `registry-auths` | | Raw authentication to registries, defined as YAML objects |
268-
| `build-secrets` | | YAML object mapping BuildKit secret IDs to secret values |
269-
| `github-token` | `${{ github.token }}` | GitHub Token used to authenticate against the repository for Git context |
266+
| Name | Default | Description |
267+
|------------------|-----------------------|--------------------------------------------------------------------------|
268+
| `registry-auths` | | Raw authentication to registries, defined as YAML objects |
269+
| `build-secrets` | | YAML object mapping BuildKit secret IDs to secret values |
270+
| `github-token` | `${{ github.token }}` | GitHub Token used to authenticate against the repository for Git context |
270271

271272
### Outputs
272273

@@ -352,6 +353,7 @@ jobs:
352353
| `artifact-name` | String | `docker-github-builder-assets` | Name of the uploaded GitHub artifact (for `local` output) |
353354
| `artifact-upload` | Bool | `false` | Upload build output GitHub artifact (for `local` output) |
354355
| `artifact-retention-days` | Number | `0` | Duration after which artifact will expire in days. `0` means using default retention |
356+
| `build-summary` | Bool | `true` | Generate a [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) |
355357
| `cache` | Bool | `false` | Enable [GitHub Actions cache](https://docs.docker.com/build/cache/backends/gha/) exporter |
356358
| `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 |
357359
| `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 |
@@ -379,7 +381,7 @@ jobs:
379381

380382
| Name | Default | Description |
381383
|------------------|-----------------------|-----------------------------------------------------------------------------------------|
382-
| `registry-auths` | | Raw authentication to registries, defined as YAML objects |
384+
| `registry-auths` | | Raw authentication to registries, defined as YAML objects |
383385
| `build-secrets` | | YAML object mapping BuildKit secret IDs to values, with optional nested target mappings |
384386
| `github-token` | `${{ github.token }}` | GitHub Token used to authenticate against the repository for Git context |
385387

0 commit comments

Comments
 (0)