diff --git a/.github/workflows/build-main-action.yaml b/.github/workflows/build-main-action.yaml index b3d5b00..d5f02de 100644 --- a/.github/workflows/build-main-action.yaml +++ b/.github/workflows/build-main-action.yaml @@ -5,6 +5,7 @@ on: push: branches: - main + - image-operation paths: - js-action/src/**/* - js-action/package*.json diff --git a/js-action/src/index.js b/js-action/src/index.js index e43e755..762e066 100644 --- a/js-action/src/index.js +++ b/js-action/src/index.js @@ -88,6 +88,14 @@ async function main() { let prePushImages = []; for (const image of buildOpts) { + if (!image.hasOwnProperty('operation')) { + image['operation'] = 'build-and-push'; + } + console.log(`${image.name} operation ${image.operation}`); + if (image.operation !== 'push' && image.operation !== 'build-and-push') { + continue; + } + const imageTag = `${registry}/${repoName}/${image.name}:${tag}`; const prePushTag = `0000001-${generateRandomString(8)}`; const imagePrePushTag = `${registry}/${repoName}/${image.name}:${prePushTag}`;