mirror of
https://github.com/docker/bake-action.git
synced 2026-06-05 09:38:40 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 867da3c872 | |||
| a06e6ea6d8 | |||
| b4514235a2 | |||
| 455cb06a8b | |||
| 95d04aff03 | |||
| ec3e762834 |
@@ -536,7 +536,6 @@ jobs:
|
||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||
driver-opts: |
|
||||
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
||||
network=host
|
||||
-
|
||||
name: Build
|
||||
uses: ./
|
||||
@@ -546,3 +545,32 @@ jobs:
|
||||
targets: app
|
||||
env:
|
||||
DOCKER_BUILD_NO_SUMMARY: true
|
||||
|
||||
export-retention-days:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
days:
|
||||
- 2
|
||||
- 0
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||
driver-opts: |
|
||||
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
||||
-
|
||||
name: Build
|
||||
uses: ./
|
||||
with:
|
||||
files: |
|
||||
./test/config.hcl
|
||||
targets: app
|
||||
env:
|
||||
DOCKER_BUILD_EXPORT_RETENTION_DAYS: ${{ matrix.days }}
|
||||
|
||||
@@ -258,9 +258,10 @@ The following outputs are available
|
||||
|
||||
### environment variables
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------------------|------|-------------------------------------------------------------------------------------------------------------------|
|
||||
| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
|
||||
| Name | Type | Description |
|
||||
|--------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
|
||||
| `DOCKER_BUILD_EXPORT_RETENTION_DAYS` | Number | Duration after which build export artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -27,7 +27,7 @@
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
"@docker/actions-toolkit": "^0.27.0",
|
||||
"@docker/actions-toolkit": "^0.28.0",
|
||||
"handlebars": "^4.7.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
+12
-1
@@ -176,6 +176,7 @@ actionsToolkit.run(
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const exportRetentionDays = buildExportRetentionDays();
|
||||
const buildxHistory = new BuildxHistory();
|
||||
const exportRes = await buildxHistory.export({
|
||||
refs: stateHelper.buildRefs
|
||||
@@ -184,7 +185,7 @@ actionsToolkit.run(
|
||||
const uploadRes = await GitHub.uploadArtifact({
|
||||
filename: exportRes.dockerbuildFilename,
|
||||
mimeType: 'application/gzip',
|
||||
retentionDays: 90
|
||||
retentionDays: exportRetentionDays
|
||||
});
|
||||
await GitHub.writeBuildSummary({
|
||||
exportRes: exportRes,
|
||||
@@ -229,3 +230,13 @@ async function buildRefs(toolkit: Toolkit, since: Date, builder?: string): Promi
|
||||
}
|
||||
return refs;
|
||||
}
|
||||
|
||||
function buildExportRetentionDays(): number | undefined {
|
||||
if (process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS) {
|
||||
const res = parseInt(process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS);
|
||||
if (isNaN(res)) {
|
||||
throw Error(`Invalid build export retention days: ${process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS}`);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1048,9 +1048,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@docker/actions-toolkit@npm:^0.27.0":
|
||||
version: 0.27.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.27.0"
|
||||
"@docker/actions-toolkit@npm:^0.28.0":
|
||||
version: 0.28.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.28.0"
|
||||
dependencies:
|
||||
"@actions/artifact": ^2.1.7
|
||||
"@actions/cache": ^3.2.4
|
||||
@@ -1073,7 +1073,7 @@ __metadata:
|
||||
semver: ^7.6.2
|
||||
tar-stream: ^3.1.7
|
||||
tmp: ^0.2.3
|
||||
checksum: 8014c5f04006b19d635dbc9e28df493afa5839f782ee00849a0d2aa86a95201a95e4602dd96311c00bd00bec92a9719df2a18148296438a79785a4af8840af69
|
||||
checksum: 1ef7d9eb861a8f102391b9b230a6cfae808ec12f48a97b32e8afe78e241e8d4c1faece71ad8f7702c7b1cfffaf0bd7f816552b6bad0b6d8a41465142a61425a6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3148,7 +3148,7 @@ __metadata:
|
||||
resolution: "docker-buildx-bake@workspace:."
|
||||
dependencies:
|
||||
"@actions/core": ^1.10.1
|
||||
"@docker/actions-toolkit": ^0.27.0
|
||||
"@docker/actions-toolkit": ^0.28.0
|
||||
"@types/node": ^20.12.12
|
||||
"@typescript-eslint/eslint-plugin": ^7.9.0
|
||||
"@typescript-eslint/parser": ^7.9.0
|
||||
|
||||
Reference in New Issue
Block a user