mirror of
https://github.com/docker/build-push-action.git
synced 2025-04-19 01:46:45 +00:00
Fix cache restoreKeys
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
bd7ed33c45
commit
6ede7e932d
3 changed files with 68 additions and 404 deletions
|
@ -1,6 +1,5 @@
|
|||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import md5 from 'md5';
|
||||
import {Inputs} from './context';
|
||||
import * as stateHelper from './state-helper';
|
||||
import * as cache from '@actions/cache';
|
||||
|
@ -13,11 +12,11 @@ export async function restoreCache(inputs: Inputs): Promise<Inputs> {
|
|||
return inputs;
|
||||
}
|
||||
|
||||
const primaryKey = `${process.env.RUNNER_OS}-docker-build-push-${md5(inputs.context)}`;
|
||||
const primaryKey = `${process.env.RUNNER_OS}-docker-build-push-${process.env.GITHUB_SHA}`;
|
||||
stateHelper.setCachePrimaryKey(primaryKey);
|
||||
|
||||
try {
|
||||
const cacheKey = await cache.restoreCache([cachePath], primaryKey);
|
||||
const cacheKey = await cache.restoreCache([cachePath], primaryKey, [`${process.env.RUNNER_OS}-docker-build-push-`]);
|
||||
|
||||
if (!cacheKey) {
|
||||
core.info(`GitHub Cache not found for key: ${primaryKey}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue