From a58fa664cca2468928fa546efb98d69e57c52e4c Mon Sep 17 00:00:00 2001 From: Dmitry Sergeev Date: Wed, 28 Feb 2024 21:31:36 +0400 Subject: [PATCH] WIP --- .github/workflows/build-main-action.yaml | 1 + js-action/src/index.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-main-action.yaml b/.github/workflows/build-main-action.yaml index b3d5b00..37c4c57 100644 --- a/.github/workflows/build-main-action.yaml +++ b/.github/workflows/build-main-action.yaml @@ -5,6 +5,7 @@ on: push: branches: - main + - secrets paths: - js-action/src/**/* - js-action/package*.json diff --git a/js-action/src/index.js b/js-action/src/index.js index d4b70d8..a4d7f78 100644 --- a/js-action/src/index.js +++ b/js-action/src/index.js @@ -62,8 +62,15 @@ async function main() { file = `--file ${image.file}`; } + let secrets = ''; + if ('secrets' in image) { + secrets = image.secrets.reduce((s,v) => { + return s + ' --secret ' + '"' + v + '"'; + }, ''); + } + // build image - runCommand(`docker build ${file} ${args} --tag ${imageTag} ${target} .`); + runCommand(`docker build ${file} ${args} ${secrets} --tag ${imageTag} ${target} .`); // Copy files