mirror of
https://github.com/docker/build-push-action.git
synced 2025-05-06 21:49:33 +02:00
generate build summary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
e51051ad0b
commit
d880b1964b
3 changed files with 34 additions and 2 deletions
10
src/main.ts
10
src/main.ts
|
@ -23,6 +23,7 @@ actionsToolkit.run(
|
|||
const startedTime = new Date();
|
||||
const inputs: context.Inputs = await context.getInputs();
|
||||
core.debug(`inputs: ${JSON.stringify(inputs)}`);
|
||||
stateHelper.setInputs(inputs);
|
||||
|
||||
const toolkit = new Toolkit();
|
||||
|
||||
|
@ -139,18 +140,23 @@ actionsToolkit.run(
|
|||
// post
|
||||
async () => {
|
||||
if (stateHelper.buildRef.length > 0) {
|
||||
await core.group(`Exporting build record`, async () => {
|
||||
await core.group(`Generating build summary`, async () => {
|
||||
try {
|
||||
const buildxHistory = new BuildxHistory();
|
||||
const exportRes = await buildxHistory.export({
|
||||
refs: [stateHelper.buildRef]
|
||||
});
|
||||
core.info(`Build record exported to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
|
||||
await GitHub.uploadArtifact({
|
||||
const uploadRes = await GitHub.uploadArtifact({
|
||||
filename: exportRes.dockerbuildFilename,
|
||||
mimeType: 'application/gzip',
|
||||
retentionDays: 90
|
||||
});
|
||||
await GitHub.writeBuildSummary({
|
||||
exportRes: exportRes,
|
||||
uploadRes: uploadRes,
|
||||
inputs: stateHelper.inputs
|
||||
});
|
||||
} catch (e) {
|
||||
core.warning(e.message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue