From c48cd101a1d6463d70e7d00b7be6b10e42f4ad92 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 08:11:42 -0800 Subject: [PATCH 01/20] refactor to support to run actions on pr --- .../build-and-push/action.yaml | 5 +- .github/workflows/docker_deps_image.yml | 12 +-- .../workflows/docker_image_main_branch.yml | 76 ++++++++++++++----- .github/workflows/docker_ngen_image.yml | 18 ++--- .github/workflows/docker_troute_image.yml | 18 ++--- 5 files changed, 82 insertions(+), 47 deletions(-) diff --git a/.github/action_templates/build-and-push/action.yaml b/.github/action_templates/build-and-push/action.yaml index 2526606..5421547 100644 --- a/.github/action_templates/build-and-push/action.yaml +++ b/.github/action_templates/build-and-push/action.yaml @@ -14,6 +14,9 @@ inputs: dockerfile-name: description: 'The name of dockerfile to use' required: true + tag-name: + description: 'The name of tag to use' + required: true runs: using: "composite" @@ -39,7 +42,7 @@ runs: push: true platforms: linux/arm64 tags: | - awiciroh/${{ inputs.image-name}}:latest + awiciroh/${{ inputs.image-name}}:${{ inputs.tag-name}} builder: mybuilder no-cache: true env: diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index a9f1985..06b5414 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -4,11 +4,12 @@ on: branches: [ main ] paths: - docker/** - pull_request: - branches: [ main ] - paths: - - docker/** workflow_dispatch: + workflow_call: + inputs: + tag_name: + required: true + type: string jobs: build-and-push: @@ -25,4 +26,5 @@ jobs: docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} github-sha: ${{ github.sha }} image-name: "ngen-deps" - dockerfile-name: "Dockerfile.ngen-deps" \ No newline at end of file + dockerfile-name: "Dockerfile.ngen-deps" + tag-name: ${{inputs.tag_name}} \ No newline at end of file diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 1f6d4c9..3f28ef5 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -4,16 +4,39 @@ on: branches: [ main ] paths: - docker/** - workflow_run: - workflows: [Build and push ngen image] - types: - - completed + pull_request: + branches: [ main ] + inputs: + tag_name: + description: 'Tag Name' + required: false + default: 'latest' + type: string workflow_dispatch: - + inputs: + tag_name: + description: 'Tag Name' + required: false + default: 'latest' + type: string + jobs: - on-success: + deps: + uses: ./.github/workflows/docker_deps_image.yml + with: + tag_name: ${{inputs.tag_name}} + troute: + needs: deps + uses: ./.github/workflows/docker_troute_image.yml + with: + tag_name: ${{inputs.tag_name}} + ngen: + needs: troute + uses: ./.github/workflows/docker_ngen_image.yml + with: + tag_name: ${{inputs.tag_name}} + final: runs-on: self-hosted - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: deploy uses: actions/checkout@v2 @@ -24,24 +47,39 @@ jobs: github-sha: ${{ github.sha }} image-name: "ciroh-ngen-image" dockerfile-name: "Dockerfile" - - name: Publish slack message - if: always() - uses: ./.github/action_templates/slack - with: - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} - job-status: ${{ job.status }} - pull_request_url: ${{ github.event.pull_request.html_url }} - head_commit_url: ${{ github.event.head_commit.url }} - on-failure: + check_result: + needs: ngen + runs-on: self-hosted + outputs: + output1: ${{ steps.step1.outputs.result }} + steps: + - id: step1 + run: echo "result=success" >> "$GITHUB_OUTPUT" + + slack: runs-on: self-hosted - if: ${{ github.event.workflow_run.conclusion == 'failure' }} + if: ${{ always() }} + needs: [deps, troute, ngen, final, check_result] + env: + OUTPUT: ${{needs.check_result.outputs.output1}} steps: - - run: echo 'The triggering workflow failed' + - name: Set env JOBSTATUS + run: | + echo "$OUTPUT" + if [[ "success" = "$OUTPUT" ]] + then + echo "JOBSTATUS=success" >> "$GITHUB_ENV" + else + echo "JOBSTATUS=failure" >> "$GITHUB_ENV" + fi + - run: echo "$JOBSTATUS" + - name: deploy + uses: actions/checkout@v2 - name: Publish slack message if: always() uses: ./.github/action_templates/slack with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} - job-status: ${{ job.status }} + job-status: ${{ env.JOBSTATUS }} pull_request_url: ${{ github.event.pull_request.html_url }} head_commit_url: ${{ github.event.head_commit.url }} \ No newline at end of file diff --git a/.github/workflows/docker_ngen_image.yml b/.github/workflows/docker_ngen_image.yml index 6aa6405..db442b6 100644 --- a/.github/workflows/docker_ngen_image.yml +++ b/.github/workflows/docker_ngen_image.yml @@ -4,16 +4,16 @@ on: branches: [ main ] paths: - docker/** - workflow_run: - workflows: [Build and push t-route image] - types: - - completed workflow_dispatch: + workflow_call: + inputs: + tag_name: + required: true + type: string jobs: - on-success: + build-and-push: runs-on: self-hosted - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: deploy uses: actions/checkout@v2 @@ -24,8 +24,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "ngen" dockerfile-name: "Dockerfile.ngen" - on-failure: - runs-on: self-hosted - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - run: echo 'The triggering workflow failed' \ No newline at end of file + tag-name: ${{inputs.tag_name}} \ No newline at end of file diff --git a/.github/workflows/docker_troute_image.yml b/.github/workflows/docker_troute_image.yml index acc0f94..8dddc8f 100644 --- a/.github/workflows/docker_troute_image.yml +++ b/.github/workflows/docker_troute_image.yml @@ -4,16 +4,16 @@ on: branches: [ main ] paths: - docker/** - workflow_run: - workflows: [Build and push deps image] - types: - - completed workflow_dispatch: + workflow_call: + inputs: + tag_name: + required: true + type: string jobs: - on-success: + build-and-push: runs-on: self-hosted - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: deploy uses: actions/checkout@v2 @@ -24,8 +24,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "t-route" dockerfile-name: "Dockerfile.t-route" - on-failure: - runs-on: self-hosted - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - run: echo 'The triggering workflow failed' \ No newline at end of file + tag-name: ${{inputs.tag_name}} \ No newline at end of file From 5b5af0e5a3d1fac4875da0a49a013b9f05d7221f Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 15:48:39 -0800 Subject: [PATCH 02/20] add debug --- .github/workflows/docker_deps_image.yml | 1 + .github/workflows/docker_image_main_branch.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index 06b5414..7e68c21 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -20,6 +20,7 @@ jobs: steps: - name: deploy uses: actions/checkout@v2 + - run: echo "auth is ${{ secrets.DOCKER_AUTH_TOKEN }}" - name: Build and push Docker image uses: ./.github/action_templates/build-and-push with: diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 3f28ef5..d90feff 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -36,6 +36,7 @@ jobs: with: tag_name: ${{inputs.tag_name}} final: + needs: ngen runs-on: self-hosted steps: - name: deploy From 49169181482babc06f054b8235fdeb2db82ad75c Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 16:33:01 -0800 Subject: [PATCH 03/20] add docker token --- .github/workflows/docker_deps_image.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index 7e68c21..a0444db 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -10,7 +10,9 @@ on: tag_name: required: true type: string - + docker-auth-token: + required: true + type: string jobs: build-and-push: runs-on: self-hosted @@ -20,11 +22,11 @@ jobs: steps: - name: deploy uses: actions/checkout@v2 - - run: echo "auth is ${{ secrets.DOCKER_AUTH_TOKEN }}" + - run: echo "auth is ${{inputs.docker-auth-token}}" - name: Build and push Docker image uses: ./.github/action_templates/build-and-push with: - docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} + docker-auth-token: ${{inputs.docker-auth-token}} github-sha: ${{ github.sha }} image-name: "ngen-deps" dockerfile-name: "Dockerfile.ngen-deps" From 117192896e79241c3b8dacb594d59a47246b5e28 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 16:34:52 -0800 Subject: [PATCH 04/20] add input --- .github/workflows/docker_image_main_branch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index d90feff..5ff9741 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -25,6 +25,7 @@ jobs: uses: ./.github/workflows/docker_deps_image.yml with: tag_name: ${{inputs.tag_name}} + docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From e73c73482338e681c6b4ec9aef3488f5011fc79e Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 16:58:00 -0800 Subject: [PATCH 05/20] add env --- .github/workflows/docker_image_main_branch.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 5ff9741..725198d 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -21,11 +21,13 @@ on: type: string jobs: + env: + docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} deps: uses: ./.github/workflows/docker_deps_image.yml with: tag_name: ${{inputs.tag_name}} - docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} + docker-auth-token: ${{ env.docker-auth-token }} troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From a5cbb1109133efadb4717e8596fd319d55baf620 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 17:08:21 -0800 Subject: [PATCH 06/20] define env --- .github/workflows/docker_image_main_branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 725198d..c825e70 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -19,10 +19,10 @@ on: required: false default: 'latest' type: string +env: + docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} jobs: - env: - docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} deps: uses: ./.github/workflows/docker_deps_image.yml with: From 404a926e19f7666eb2da32385b7f512e826c5f15 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 17:10:48 -0800 Subject: [PATCH 07/20] define env --- .github/workflows/docker_image_main_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index c825e70..ff55088 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -27,7 +27,7 @@ jobs: uses: ./.github/workflows/docker_deps_image.yml with: tag_name: ${{inputs.tag_name}} - docker-auth-token: ${{ env.docker-auth-token }} + docker-auth-token: $docker-auth-token troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From d104415200f448084d666fd2e491ee447627107e Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 17:15:01 -0800 Subject: [PATCH 08/20] define env --- .github/workflows/docker_image_main_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index ff55088..c825e70 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -27,7 +27,7 @@ jobs: uses: ./.github/workflows/docker_deps_image.yml with: tag_name: ${{inputs.tag_name}} - docker-auth-token: $docker-auth-token + docker-auth-token: ${{ env.docker-auth-token }} troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From 5ec78f0536459031957a94cf0128e43960f150df Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 17:19:43 -0800 Subject: [PATCH 09/20] define env --- .github/workflows/docker_image_main_branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index c825e70..637ebe4 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -19,8 +19,6 @@ on: required: false default: 'latest' type: string -env: - docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} jobs: deps: @@ -28,6 +26,8 @@ jobs: with: tag_name: ${{inputs.tag_name}} docker-auth-token: ${{ env.docker-auth-token }} + env: + docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From 9840c999f4a5af132222fd3d6958d909be0cb378 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 17:36:50 -0800 Subject: [PATCH 10/20] add secrets --- .github/workflows/docker_deps_image.yml | 5 +---- .github/workflows/docker_image_main_branch.yml | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index a0444db..787e810 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -10,9 +10,6 @@ on: tag_name: required: true type: string - docker-auth-token: - required: true - type: string jobs: build-and-push: runs-on: self-hosted @@ -26,7 +23,7 @@ jobs: - name: Build and push Docker image uses: ./.github/action_templates/build-and-push with: - docker-auth-token: ${{inputs.docker-auth-token}} + docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} github-sha: ${{ github.sha }} image-name: "ngen-deps" dockerfile-name: "Dockerfile.ngen-deps" diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 637ebe4..dc2deef 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -25,9 +25,8 @@ jobs: uses: ./.github/workflows/docker_deps_image.yml with: tag_name: ${{inputs.tag_name}} - docker-auth-token: ${{ env.docker-auth-token }} - env: - docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} + secrets: + DOCKER_AUTH_TOKEN: ${{ secrets.DOCKER_AUTH_TOKEN }} troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From ebcff0dd3130fa2fcdaf60f207eb6e20e040cfd5 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 17:42:08 -0800 Subject: [PATCH 11/20] add secrets --- .github/workflows/docker_image_main_branch.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index dc2deef..4a84aff 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -25,8 +25,7 @@ jobs: uses: ./.github/workflows/docker_deps_image.yml with: tag_name: ${{inputs.tag_name}} - secrets: - DOCKER_AUTH_TOKEN: ${{ secrets.DOCKER_AUTH_TOKEN }} + secrets: inherit troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml From 3ec112f8a30aa9fec5d81a4e8e3d2a1b6d29c632 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 18:30:20 -0800 Subject: [PATCH 12/20] secrets inherit --- .github/workflows/docker_image_main_branch.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 4a84aff..cc79edc 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -31,11 +31,13 @@ jobs: uses: ./.github/workflows/docker_troute_image.yml with: tag_name: ${{inputs.tag_name}} + secrets: inherit ngen: needs: troute uses: ./.github/workflows/docker_ngen_image.yml with: tag_name: ${{inputs.tag_name}} + secrets: inherit final: needs: ngen runs-on: self-hosted From c98d6e57c11a989724925ae367cfa94f21228a93 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 19:12:34 -0800 Subject: [PATCH 13/20] fix tag name --- .github/workflows/docker_image_main_branch.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index cc79edc..37669e6 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -51,8 +51,9 @@ jobs: github-sha: ${{ github.sha }} image-name: "ciroh-ngen-image" dockerfile-name: "Dockerfile" + tag_name: ${{inputs.tag_name}} check_result: - needs: ngen + needs: final runs-on: self-hosted outputs: output1: ${{ steps.step1.outputs.result }} From f0f936dce83c97283cfbd1fa91bd93fe2852dfa0 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 20:09:53 -0800 Subject: [PATCH 14/20] fix tag name --- .github/workflows/docker_image_main_branch.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 37669e6..f9fcafb 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -41,6 +41,8 @@ jobs: final: needs: ngen runs-on: self-hosted + env: + tag_name: ${{inputs.tag_name}} steps: - name: deploy uses: actions/checkout@v2 @@ -51,7 +53,7 @@ jobs: github-sha: ${{ github.sha }} image-name: "ciroh-ngen-image" dockerfile-name: "Dockerfile" - tag_name: ${{inputs.tag_name}} + tag_name: ${{env.tag_name}} check_result: needs: final runs-on: self-hosted From 5a1be866fd2a9451fe654ea1e4ed267b72769b87 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Tue, 2 Jan 2024 21:14:43 -0800 Subject: [PATCH 15/20] fix tag name --- .github/workflows/docker_image_main_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index f9fcafb..411ecd4 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -53,7 +53,7 @@ jobs: github-sha: ${{ github.sha }} image-name: "ciroh-ngen-image" dockerfile-name: "Dockerfile" - tag_name: ${{env.tag_name}} + tag-name: ${{env.tag_name}} check_result: needs: final runs-on: self-hosted From b860b72899896695375a9168c2dd4cecb8fa1b33 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Wed, 3 Jan 2024 08:27:24 -0800 Subject: [PATCH 16/20] set input required --- .github/workflows/docker_image_main_branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 411ecd4..ac007be 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -9,14 +9,14 @@ on: inputs: tag_name: description: 'Tag Name' - required: false + required: true default: 'latest' type: string workflow_dispatch: inputs: tag_name: description: 'Tag Name' - required: false + required: true default: 'latest' type: string From 5c499b8691c191bd30c4b76bd1bd2114530f0b1d Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Wed, 3 Jan 2024 15:44:37 -0800 Subject: [PATCH 17/20] fix --- .github/workflows/docker_deps_image.yml | 1 + .github/workflows/docker_image_main_branch.yml | 6 ------ .github/workflows/docker_ngen_image.yml | 1 + .github/workflows/docker_troute_image.yml | 1 + 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index 787e810..87aafcb 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -9,6 +9,7 @@ on: inputs: tag_name: required: true + default: 'latest' type: string jobs: build-and-push: diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index ac007be..eee17d8 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -6,12 +6,6 @@ on: - docker/** pull_request: branches: [ main ] - inputs: - tag_name: - description: 'Tag Name' - required: true - default: 'latest' - type: string workflow_dispatch: inputs: tag_name: diff --git a/.github/workflows/docker_ngen_image.yml b/.github/workflows/docker_ngen_image.yml index db442b6..b9d4c0d 100644 --- a/.github/workflows/docker_ngen_image.yml +++ b/.github/workflows/docker_ngen_image.yml @@ -9,6 +9,7 @@ on: inputs: tag_name: required: true + default: 'latest' type: string jobs: diff --git a/.github/workflows/docker_troute_image.yml b/.github/workflows/docker_troute_image.yml index 8dddc8f..1c58144 100644 --- a/.github/workflows/docker_troute_image.yml +++ b/.github/workflows/docker_troute_image.yml @@ -9,6 +9,7 @@ on: inputs: tag_name: required: true + default: 'latest' type: string jobs: From 904b9db6822a5f3129b3fc3fcf0b427d54d1b2f7 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Wed, 3 Jan 2024 20:30:13 -0800 Subject: [PATCH 18/20] use vars --- .github/workflows/docker_deps_image.yml | 7 +------ .github/workflows/docker_image_main_branch.yml | 16 +--------------- .github/workflows/docker_ngen_image.yml | 7 +------ .github/workflows/docker_troute_image.yml | 7 +------ 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index 87aafcb..9fa8efb 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -6,11 +6,6 @@ on: - docker/** workflow_dispatch: workflow_call: - inputs: - tag_name: - required: true - default: 'latest' - type: string jobs: build-and-push: runs-on: self-hosted @@ -28,4 +23,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "ngen-deps" dockerfile-name: "Dockerfile.ngen-deps" - tag-name: ${{inputs.tag_name}} \ No newline at end of file + tag-name: ${{vars.TAG_NAME} \ No newline at end of file diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index eee17d8..f28bea7 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -7,36 +7,22 @@ on: pull_request: branches: [ main ] workflow_dispatch: - inputs: - tag_name: - description: 'Tag Name' - required: true - default: 'latest' - type: string jobs: deps: uses: ./.github/workflows/docker_deps_image.yml - with: - tag_name: ${{inputs.tag_name}} secrets: inherit troute: needs: deps uses: ./.github/workflows/docker_troute_image.yml - with: - tag_name: ${{inputs.tag_name}} secrets: inherit ngen: needs: troute uses: ./.github/workflows/docker_ngen_image.yml - with: - tag_name: ${{inputs.tag_name}} secrets: inherit final: needs: ngen runs-on: self-hosted - env: - tag_name: ${{inputs.tag_name}} steps: - name: deploy uses: actions/checkout@v2 @@ -47,7 +33,7 @@ jobs: github-sha: ${{ github.sha }} image-name: "ciroh-ngen-image" dockerfile-name: "Dockerfile" - tag-name: ${{env.tag_name}} + tag-name: ${{vars.TAG_NAME} check_result: needs: final runs-on: self-hosted diff --git a/.github/workflows/docker_ngen_image.yml b/.github/workflows/docker_ngen_image.yml index b9d4c0d..fdd03bc 100644 --- a/.github/workflows/docker_ngen_image.yml +++ b/.github/workflows/docker_ngen_image.yml @@ -6,11 +6,6 @@ on: - docker/** workflow_dispatch: workflow_call: - inputs: - tag_name: - required: true - default: 'latest' - type: string jobs: build-and-push: @@ -25,4 +20,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "ngen" dockerfile-name: "Dockerfile.ngen" - tag-name: ${{inputs.tag_name}} \ No newline at end of file + tag-name: ${{vars.TAG_NAME} \ No newline at end of file diff --git a/.github/workflows/docker_troute_image.yml b/.github/workflows/docker_troute_image.yml index 1c58144..90e07da 100644 --- a/.github/workflows/docker_troute_image.yml +++ b/.github/workflows/docker_troute_image.yml @@ -6,11 +6,6 @@ on: - docker/** workflow_dispatch: workflow_call: - inputs: - tag_name: - required: true - default: 'latest' - type: string jobs: build-and-push: @@ -25,4 +20,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "t-route" dockerfile-name: "Dockerfile.t-route" - tag-name: ${{inputs.tag_name}} \ No newline at end of file + tag-name: ${{vars.TAG_NAME} \ No newline at end of file From c50040ebe607946107a07544b153b6bd1f281f56 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Wed, 3 Jan 2024 20:31:31 -0800 Subject: [PATCH 19/20] fix variable --- .github/workflows/docker_deps_image.yml | 2 +- .github/workflows/docker_image_main_branch.yml | 2 +- .github/workflows/docker_ngen_image.yml | 2 +- .github/workflows/docker_troute_image.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index 9fa8efb..fc233bb 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -23,4 +23,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "ngen-deps" dockerfile-name: "Dockerfile.ngen-deps" - tag-name: ${{vars.TAG_NAME} \ No newline at end of file + tag-name: ${{vars.TAG_NAME}} \ No newline at end of file diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index f28bea7..ba01db3 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -33,7 +33,7 @@ jobs: github-sha: ${{ github.sha }} image-name: "ciroh-ngen-image" dockerfile-name: "Dockerfile" - tag-name: ${{vars.TAG_NAME} + tag-name: ${{vars.TAG_NAME}} check_result: needs: final runs-on: self-hosted diff --git a/.github/workflows/docker_ngen_image.yml b/.github/workflows/docker_ngen_image.yml index fdd03bc..09d40a9 100644 --- a/.github/workflows/docker_ngen_image.yml +++ b/.github/workflows/docker_ngen_image.yml @@ -20,4 +20,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "ngen" dockerfile-name: "Dockerfile.ngen" - tag-name: ${{vars.TAG_NAME} \ No newline at end of file + tag-name: ${{vars.TAG_NAME}} \ No newline at end of file diff --git a/.github/workflows/docker_troute_image.yml b/.github/workflows/docker_troute_image.yml index 90e07da..57e00ea 100644 --- a/.github/workflows/docker_troute_image.yml +++ b/.github/workflows/docker_troute_image.yml @@ -20,4 +20,4 @@ jobs: github-sha: ${{ github.sha }} image-name: "t-route" dockerfile-name: "Dockerfile.t-route" - tag-name: ${{vars.TAG_NAME} \ No newline at end of file + tag-name: ${{vars.TAG_NAME}} \ No newline at end of file From 49ff8df433fdd1f2f7304310baa3ab8b30fa7473 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Wed, 3 Jan 2024 22:00:57 -0800 Subject: [PATCH 20/20] remove debug --- .github/workflows/docker_deps_image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker_deps_image.yml b/.github/workflows/docker_deps_image.yml index fc233bb..ee8d27b 100644 --- a/.github/workflows/docker_deps_image.yml +++ b/.github/workflows/docker_deps_image.yml @@ -15,7 +15,6 @@ jobs: steps: - name: deploy uses: actions/checkout@v2 - - run: echo "auth is ${{inputs.docker-auth-token}}" - name: Build and push Docker image uses: ./.github/action_templates/build-and-push with: