Build push action v2

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-16 00:36:41 +02:00
parent 3f08c86128
commit 99bea387ee
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
22 changed files with 2778 additions and 314 deletions

18
src/buildx.ts Normal file
View file

@ -0,0 +1,18 @@
import * as exec from './exec';
export async function isAvailable(): Promise<Boolean> {
return await exec.exec(`docker`, ['buildx'], true).then(res => {
if (res.stderr != '' && !res.success) {
return false;
}
return res.success;
});
}
export async function use(builder: string): Promise<void> {
return await exec.exec(`docker`, ['buildx', 'use', '--builder', builder], false).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
});
}