mirror of
https://github.com/docker/build-push-action.git
synced 2025-05-06 13:39:30 +02:00
Merge 6ccec6a887
into 0ec91264d8
This commit is contained in:
commit
d4b6ff3a5c
7 changed files with 48 additions and 10 deletions
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
|
@ -1464,6 +1464,35 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
|
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
|
||||||
|
|
||||||
|
export-legacy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
legacy:
|
||||||
|
- false
|
||||||
|
- true
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: action
|
||||||
|
-
|
||||||
|
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: ./action
|
||||||
|
with:
|
||||||
|
file: ./test/Dockerfile
|
||||||
|
env:
|
||||||
|
DOCKER_BUILD_EXPORT_LEGACY: ${{ matrix.legacy }}
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -277,6 +277,7 @@ The following outputs are available:
|
||||||
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
|
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
|
||||||
| `DOCKER_BUILD_RECORD_UPLOAD` | Bool | `true` | If `false`, build record upload as [GitHub artifact](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) is disabled |
|
| `DOCKER_BUILD_RECORD_UPLOAD` | Bool | `true` | If `false`, build record upload as [GitHub artifact](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) is disabled |
|
||||||
| `DOCKER_BUILD_RECORD_RETENTION_DAYS` | Number | | Duration after which build record 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` |
|
| `DOCKER_BUILD_RECORD_RETENTION_DAYS` | Number | | Duration after which build record 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` |
|
||||||
|
| `DOCKER_BUILD_EXPORT_LEGACY` | Bool | `false` | If `true`, exports build using legacy export-build tool instead of [`buildx history export` command](https://docs.docker.com/reference/cli/docker/buildx/history/export/) |
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@
|
||||||
"packageManager": "yarn@3.6.3",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@docker/actions-toolkit": "0.59.0",
|
"@docker/actions-toolkit": "0.60.0",
|
||||||
"handlebars": "^4.7.7"
|
"handlebars": "^4.7.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -200,7 +200,8 @@ actionsToolkit.run(
|
||||||
|
|
||||||
const buildxHistory = new BuildxHistory();
|
const buildxHistory = new BuildxHistory();
|
||||||
const exportRes = await buildxHistory.export({
|
const exportRes = await buildxHistory.export({
|
||||||
refs: stateHelper.buildRef ? [stateHelper.buildRef] : []
|
refs: stateHelper.buildRef ? [stateHelper.buildRef] : [],
|
||||||
|
useContainer: buildExportLegacy()
|
||||||
});
|
});
|
||||||
core.info(`Build record written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
|
core.info(`Build record written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
|
||||||
|
|
||||||
|
@ -294,3 +295,10 @@ function buildRecordRetentionDays(): number | undefined {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildExportLegacy(): boolean {
|
||||||
|
if (process.env.DOCKER_BUILD_EXPORT_LEGACY) {
|
||||||
|
return Util.parseBool(process.env.DOCKER_BUILD_EXPORT_LEGACY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -1072,9 +1072,9 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@docker/actions-toolkit@npm:0.59.0":
|
"@docker/actions-toolkit@npm:0.60.0":
|
||||||
version: 0.59.0
|
version: 0.60.0
|
||||||
resolution: "@docker/actions-toolkit@npm:0.59.0"
|
resolution: "@docker/actions-toolkit@npm:0.60.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/artifact": ^2.3.2
|
"@actions/artifact": ^2.3.2
|
||||||
"@actions/cache": ^4.0.3
|
"@actions/cache": ^4.0.3
|
||||||
|
@ -1097,7 +1097,7 @@ __metadata:
|
||||||
semver: ^7.7.1
|
semver: ^7.7.1
|
||||||
tar-stream: ^3.1.7
|
tar-stream: ^3.1.7
|
||||||
tmp: ^0.2.3
|
tmp: ^0.2.3
|
||||||
checksum: 0956071aa04e04132b789d47ba57813c566115bea9fdedf3c648d0a0da8ce12350de9cd2a796ce1da7b64b995ae073bfe344b0f63c6f331a45e60195e15680a6
|
checksum: dc7d15b00b8e935b2e4813a0db08b67d4fb6817f6455fd7be1c51cb56a5beeec692c86b2f333437f6dafe81a74e08a38fcff5300384182c733f8a2cfa322f07b
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
@ -3143,7 +3143,7 @@ __metadata:
|
||||||
resolution: "docker-build-push@workspace:."
|
resolution: "docker-build-push@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.11.1
|
"@actions/core": ^1.11.1
|
||||||
"@docker/actions-toolkit": 0.59.0
|
"@docker/actions-toolkit": 0.60.0
|
||||||
"@types/node": ^20.12.12
|
"@types/node": ^20.12.12
|
||||||
"@typescript-eslint/eslint-plugin": ^7.9.0
|
"@typescript-eslint/eslint-plugin": ^7.9.0
|
||||||
"@typescript-eslint/parser": ^7.9.0
|
"@typescript-eslint/parser": ^7.9.0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue