Add subdirectory for Git context

Since v0.9.0 of BuildKit (BuildX v0.7.0) you can provide a subdirectory
to the default Git context.

Closes #460
Closes #528

Signed-off-by: Jim Brännlund <jimbrannlund@fastmail.com>
This commit is contained in:
Jim Brännlund 2021-12-28 00:49:32 +01:00
parent b1aeb1103e
commit fc5a732e0c
6 changed files with 8436 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import {issueCommand} from '@actions/core/lib/command';
import * as github from '@actions/github';
import * as buildx from './buildx';
import * as handlebars from 'handlebars';
let _defaultContext, _tmpDir: string;
@ -97,7 +98,7 @@ export async function getArgs(inputs: Inputs, defaultContext: string, buildxVers
let args: Array<string> = ['buildx'];
args.push.apply(args, await getBuildArgs(inputs, defaultContext, buildxVersion));
args.push.apply(args, await getCommonArgs(inputs, buildxVersion));
args.push(inputs.context);
args.push(handlebars.compile(inputs.context)({defaultContext}));
return args;
}