Support to retain cache

Signed-off-by: Balaji Arun <balajia@vt.edu>
This commit is contained in:
Balaji Arun
2023-02-23 13:11:05 -08:00
committed by CrazyMax
parent 3f1544eb9e
commit 4143b5899b
6 changed files with 88 additions and 11 deletions

View File

@@ -115,6 +115,7 @@ actionsToolkit.run(
});
}
}
stateHelper.setKeepState(inputs.keepState);
if (inputs.driver !== 'docker') {
await core.group(`Creating a new builder instance`, async () => {
@@ -249,7 +250,7 @@ actionsToolkit.run(
const buildx = new Buildx({standalone: stateHelper.standalone});
const builder = new Builder({buildx: buildx});
if (await builder.exists(stateHelper.builderName)) {
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName, ...(stateHelper.keepState ? ['--keep-state'] : [])]);
await Exec.getExecOutput(rmCmd.command, rmCmd.args, {
ignoreReturnCode: true
}).then(res => {