mirror of
https://github.com/docker/build-push-action.git
synced 2025-04-20 18:26:46 +00:00
Build push action v2
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
3f08c86128
commit
99bea387ee
22 changed files with 2778 additions and 314 deletions
18
src/buildx.ts
Normal file
18
src/buildx.ts
Normal 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);
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue