From 41741bf73d30482f35aa9a45bc8e4ea8bba3b985 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 14:40:48 -0800 Subject: [PATCH 01/30] feat(ci): test cross-repo workflows --- .github/workflows/pr-open.yml | 95 +++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 979bec156..f50a70557 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -30,55 +30,66 @@ jobs: tag: ${{ github.event.number }} tag_fallback: latest triggers: ('${{ matrix.package }}/') - - # https://github.com/bcgov-nr/action-deployer-openshift - deploys: - name: Deploys + + test: + name: Test needs: [builds] - uses: ./.github/workflows/.deploy.yml + uses: bcgov-nr/action-support./.github/workflows/.deploy.yml secrets: inherit with: - build_outputs: ${{ needs.builds.outputs.digest }} - tag: ${{ github.event.number }} - release: ${{ github.event.number }} + packages: "migrations, backend, frontend" + repository: ${{ github.repository }} + promote_from: ${{ github.event.number }} + promote_to: blorf - validate: - name: Validate - needs: [deploys] - if: always() && (!cancelled()) && (!failure()) - env: - DOMAIN: apps.silver.devops.gov.bc.ca - PREFIX: ${{ github.event.repository.name }} - permissions: - pull-requests: write - runs-on: ubuntu-22.04 - steps: - - uses: amannn/action-semantic-pull-request@v5.4.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # # https://github.com/bcgov-nr/action-deployer-openshift + # deploys: + # name: Deploys + # needs: [builds] + # uses: ./.github/workflows/.deploy.yml + # secrets: inherit + # with: + # build_outputs: ${{ needs.builds.outputs.digest }} + # tag: ${{ github.event.number }} + # release: ${{ github.event.number }} - - if: failure() - run: | - echo "Please use conventional commits in your PR title and re-run this job." - echo "https://www.conventionalcommits.org/en/v1.0.0/" - exit 1 + # validate: + # name: Validate + # needs: [deploys] + # if: always() && (!cancelled()) && (!failure()) + # env: + # DOMAIN: apps.silver.devops.gov.bc.ca + # PREFIX: ${{ github.event.repository.name }} + # permissions: + # pull-requests: write + # runs-on: ubuntu-22.04 + # steps: + # - uses: amannn/action-semantic-pull-request@v5.4.0 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: bcgov-nr/action-pr-description-add@v1.1.1 - env: - DOMAIN: apps.silver.devops.gov.bc.ca - PREFIX: ${{ github.event.repository.name }} - with: - add_markdown: | - --- + # - if: failure() + # run: | + # echo "Please use conventional commits in your PR title and re-run this job." + # echo "https://www.conventionalcommits.org/en/v1.0.0/" + # exit 1 + + # - uses: bcgov-nr/action-pr-description-add@v1.1.1 + # env: + # DOMAIN: apps.silver.devops.gov.bc.ca + # PREFIX: ${{ github.event.repository.name }} + # with: + # add_markdown: | + # --- - Thanks for the PR! + # Thanks for the PR! - Deployments, as required, will be available below: - - [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}) - - [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api) + # Deployments, as required, will be available below: + # - [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}) + # - [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api) - Please create PRs in draft mode. Mark as ready to enable: - - [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml) + # Please create PRs in draft mode. Mark as ready to enable: + # - [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml) - After merge, new images are deployed in: - - [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml) + # After merge, new images are deployed in: + # - [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml) From 38ed8965324491fe1525133706c2e03e526c4a52 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 14:43:41 -0800 Subject: [PATCH 02/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index f50a70557..1dad96c6b 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -34,7 +34,7 @@ jobs: test: name: Test needs: [builds] - uses: bcgov-nr/action-support./.github/workflows/.deploy.yml + uses: bcgov-nr/action-support./.github/workflows/.deploy.yml@main secrets: inherit with: packages: "migrations, backend, frontend" From da7b454f66625c7088962a5f67eb81e4037fb7d2 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 14:56:47 -0800 Subject: [PATCH 03/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 1dad96c6b..d4ad37a73 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -34,7 +34,7 @@ jobs: test: name: Test needs: [builds] - uses: bcgov-nr/action-support./.github/workflows/.deploy.yml@main + uses: bcgov-nr/action-support/.github/workflows/.deploy.yml@main secrets: inherit with: packages: "migrations, backend, frontend" From e78a8fee364d36012e34f19c24d30b43c924c502 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 14:58:42 -0800 Subject: [PATCH 04/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index d4ad37a73..32864c681 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -34,7 +34,7 @@ jobs: test: name: Test needs: [builds] - uses: bcgov-nr/action-support/.github/workflows/.deploy.yml@main + uses: bcgov-nr/action-support/.github/workflows/pr-close.yml@main secrets: inherit with: packages: "migrations, backend, frontend" From ad1e0c6ccfc585b16f53d60b7d5fcd7408e4c954 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 15:07:31 -0800 Subject: [PATCH 05/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 32864c681..f0bde9173 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -29,7 +29,7 @@ jobs: package: ${{ matrix.package }} tag: ${{ github.event.number }} tag_fallback: latest - triggers: ('${{ matrix.package }}/') + # triggers: ('${{ matrix.package }}/') test: name: Test From 19141f98bc844b06c9b40a5fce93cd9068d943a1 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 15:36:43 -0800 Subject: [PATCH 06/30] Test --- .github/workflows/pr-open.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index f0bde9173..481ddfad5 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -35,7 +35,6 @@ jobs: name: Test needs: [builds] uses: bcgov-nr/action-support/.github/workflows/pr-close.yml@main - secrets: inherit with: packages: "migrations, backend, frontend" repository: ${{ github.repository }} From 1e7b14ebb1c079c69ea8fb782fcf752f8cabc4fc Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 15:42:37 -0800 Subject: [PATCH 07/30] Test --- .github/workflows/pr-open.yml | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 481ddfad5..2de877672 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,34 +9,34 @@ concurrency: cancel-in-progress: true jobs: - # https://github.com/bcgov-nr/action-builder-ghcr - builds: - name: Builds - runs-on: ubuntu-22.04 - permissions: - packages: write - outputs: - digest: ${{ steps.builds.outputs.digest }} - strategy: - matrix: - package: [migrations, backend, frontend] - timeout-minutes: 10 - steps: - - uses: bcgov-nr/action-builder-ghcr@v2.0.2 - id: builds - with: - keep_versions: 50 - package: ${{ matrix.package }} - tag: ${{ github.event.number }} - tag_fallback: latest - # triggers: ('${{ matrix.package }}/') + # # https://github.com/bcgov-nr/action-builder-ghcr + # builds: + # name: Builds + # runs-on: ubuntu-22.04 + # permissions: + # packages: write + # outputs: + # digest: ${{ steps.builds.outputs.digest }} + # strategy: + # matrix: + # package: [migrations, backend, frontend] + # timeout-minutes: 10 + # steps: + # - uses: bcgov-nr/action-builder-ghcr@v2.0.2 + # id: builds + # with: + # keep_versions: 50 + # package: ${{ matrix.package }} + # tag: ${{ github.event.number }} + # tag_fallback: latest + # # triggers: ('${{ matrix.package }}/') test: name: Test - needs: [builds] + # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/pr-close.yml@main with: - packages: "migrations, backend, frontend" + packages: "[migrations, backend, frontend]" repository: ${{ github.repository }} promote_from: ${{ github.event.number }} promote_to: blorf From 1c57f7033e044033f39901dd291815376278db69 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 15:44:00 -0800 Subject: [PATCH 08/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 2de877672..5b669714c 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -39,7 +39,7 @@ jobs: packages: "[migrations, backend, frontend]" repository: ${{ github.repository }} promote_from: ${{ github.event.number }} - promote_to: blorf + promote_to: testomundo # # https://github.com/bcgov-nr/action-deployer-openshift # deploys: From 2268805c6726b911dc4b5bd247b125e97c748a56 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 15:45:54 -0800 Subject: [PATCH 09/30] Test --- .github/workflows/analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 3e5b317d7..28791a77d 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -3,8 +3,8 @@ name: Analysis on: push: branches: [main] - pull_request: - types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] + # pull_request: + # types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] schedule: - cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays workflow_dispatch: From d43467bcef3be0743aede1b8ff99de67668b5ff5 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 13 Feb 2024 16:08:38 -0800 Subject: [PATCH 10/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 5b669714c..cbb087444 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -39,7 +39,7 @@ jobs: packages: "[migrations, backend, frontend]" repository: ${{ github.repository }} promote_from: ${{ github.event.number }} - promote_to: testomundo + promote_to: testy # # https://github.com/bcgov-nr/action-deployer-openshift # deploys: From 285a5842b4f183a615dc6f3a3928d3d6aa2c7c2f Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:10:37 -0800 Subject: [PATCH 11/30] Test --- .github/workflows/pr-open.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index cbb087444..754b04d3b 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -34,12 +34,10 @@ jobs: test: name: Test # needs: [builds] - uses: bcgov-nr/action-support/.github/workflows/pr-close.yml@main + uses: bcgov-nr/action-support/.github/workflows/pr-close.yml@feat/pr-close with: - packages: "[migrations, backend, frontend]" - repository: ${{ github.repository }} - promote_from: ${{ github.event.number }} - promote_to: testy + cleanup: helm + packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift # deploys: From d813248e8beffcaf0eccb7c4e1a9e3b3cb8f78ba Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:12:02 -0800 Subject: [PATCH 12/30] Test --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 754b04d3b..1fa544a85 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -34,7 +34,7 @@ jobs: test: name: Test # needs: [builds] - uses: bcgov-nr/action-support/.github/workflows/pr-close.yml@feat/pr-close + uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close with: cleanup: helm packages: backend frontend From 1a9591d1f6e9f31ff946028c2771a73b77b99a41 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:14:29 -0800 Subject: [PATCH 13/30] Test --- .github/workflows/pr-open.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 1fa544a85..8f40ec029 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -35,6 +35,7 @@ jobs: name: Test # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close + secrets: inherit with: cleanup: helm packages: backend frontend From bd58a980c10ee0c53284eb39ade27c589891a34c Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:27:06 -0800 Subject: [PATCH 14/30] Test --- .github/workflows/pr-open.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 8f40ec029..c284e7c61 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -38,7 +38,9 @@ jobs: secrets: inherit with: cleanup: helm - packages: backend frontend + oc_namespace: ${{ vars.OC_NAMESPACE }} + oc_token: ${{ secrets.OC_TOKEN }} + # packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift # deploys: From 9b02a276841d95368f9b3da94956b6633684a783 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:35:48 -0800 Subject: [PATCH 15/30] Test secrets --- .github/workflows/pr-open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index c284e7c61..1e8312f6d 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -38,8 +38,8 @@ jobs: secrets: inherit with: cleanup: helm - oc_namespace: ${{ vars.OC_NAMESPACE }} - oc_token: ${{ secrets.OC_TOKEN }} + oc_namespace: ${{ vars.oc_namespace }} + oc_token: ${{ secrets.oc_token }} # packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift From d2820e70db43d3afc4170d4d21fb6a906124448f Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:36:44 -0800 Subject: [PATCH 16/30] Test secrets --- .github/workflows/pr-open.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 1e8312f6d..43c182aa8 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -36,10 +36,11 @@ jobs: # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: inherit + secrets: + oc_token: ${{ secrets.oc_token }} with: cleanup: helm oc_namespace: ${{ vars.oc_namespace }} - oc_token: ${{ secrets.oc_token }} # packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift From 6fa1b5b7e56453a8a5e98d99edc26e552118f617 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:37:12 -0800 Subject: [PATCH 17/30] Test secrets --- .github/workflows/pr-open.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 43c182aa8..b98e0dbdc 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -35,7 +35,6 @@ jobs: name: Test # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close - secrets: inherit secrets: oc_token: ${{ secrets.oc_token }} with: From 82c9dec5ebb004c5c385eece411fae117b77f6ef Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:39:35 -0800 Subject: [PATCH 18/30] Test secrets --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index b98e0dbdc..0a1f59740 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -40,7 +40,7 @@ jobs: with: cleanup: helm oc_namespace: ${{ vars.oc_namespace }} - # packages: backend frontend + packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift # deploys: From 53f9a037b2c239124edfdab54615ae9555d6db51 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:42:08 -0800 Subject: [PATCH 19/30] Test secrets --- .github/workflows/pr-open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 0a1f59740..f685a9a5d 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -36,10 +36,10 @@ jobs: # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: - oc_token: ${{ secrets.oc_token }} + oc_token: ${{ secrets.OC_TOKEN }} with: cleanup: helm - oc_namespace: ${{ vars.oc_namespace }} + oc_namespace: ${{ vars.OC_NAMESPACE }} packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift From b9310ab0000a4c0ba53358cac0b4bfd7554637c6 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:48:13 -0800 Subject: [PATCH 20/30] Test secrets --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index f685a9a5d..6817f12cd 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -32,7 +32,7 @@ jobs: # # triggers: ('${{ matrix.package }}/') test: - name: Test + # name: Test # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: From dc2432a0e9d493096517ecaade075e6ccf5e6aab Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:48:53 -0800 Subject: [PATCH 21/30] Test secrets --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 6817f12cd..75684ab8f 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -36,7 +36,7 @@ jobs: # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: - oc_token: ${{ secrets.OC_TOKEN }} + token: ${{ secrets.OC_TOKEN }} with: cleanup: helm oc_namespace: ${{ vars.OC_NAMESPACE }} From ccde7f23ae859a5891b2481c4ec65509926ad0b8 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:53:58 -0800 Subject: [PATCH 22/30] Test secrets --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 75684ab8f..2f31bd845 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -32,7 +32,7 @@ jobs: # # triggers: ('${{ matrix.package }}/') test: - # name: Test + name: Test # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: From 31dffe98ad94a57d2a1c8061f36fa3d4791e245e Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:55:26 -0800 Subject: [PATCH 23/30] Test secrets --- .github/workflows/pr-open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 2f31bd845..aa709a3ea 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -36,11 +36,11 @@ jobs: # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: - token: ${{ secrets.OC_TOKEN }} + token: anything with: cleanup: helm oc_namespace: ${{ vars.OC_NAMESPACE }} - packages: backend frontend + # packages: backend frontend # # https://github.com/bcgov-nr/action-deployer-openshift # deploys: From 8869996b97ddc73e8159a699bcaf21f56c8353f1 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 13:58:49 -0800 Subject: [PATCH 24/30] Test secrets --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index aa709a3ea..521d76a95 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -36,7 +36,7 @@ jobs: # needs: [builds] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: - token: anything + token: ${{ secrets.OC_TOKEN }} with: cleanup: helm oc_namespace: ${{ vars.OC_NAMESPACE }} From 69645a7416bf1f9ccb39bb03988cff5bda3c6a41 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:04:19 -0800 Subject: [PATCH 25/30] Build and test common close code --- .github/workflows/pr-open.yml | 72 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 521d76a95..3def6ca2b 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,49 +9,49 @@ concurrency: cancel-in-progress: true jobs: - # # https://github.com/bcgov-nr/action-builder-ghcr - # builds: - # name: Builds - # runs-on: ubuntu-22.04 - # permissions: - # packages: write - # outputs: - # digest: ${{ steps.builds.outputs.digest }} - # strategy: - # matrix: - # package: [migrations, backend, frontend] - # timeout-minutes: 10 - # steps: - # - uses: bcgov-nr/action-builder-ghcr@v2.0.2 - # id: builds - # with: - # keep_versions: 50 - # package: ${{ matrix.package }} - # tag: ${{ github.event.number }} - # tag_fallback: latest - # # triggers: ('${{ matrix.package }}/') - + # https://github.com/bcgov-nr/action-builder-ghcr + builds: + name: Builds + runs-on: ubuntu-22.04 + permissions: + packages: write + outputs: + digest: ${{ steps.builds.outputs.digest }} + strategy: + matrix: + package: [migrations, backend, frontend] + timeout-minutes: 10 + steps: + - uses: bcgov-nr/action-builder-ghcr@v2.0.2 + id: builds + with: + keep_versions: 50 + package: ${{ matrix.package }} + tag: ${{ github.event.number }} + tag_fallback: latest + # triggers: ('${{ matrix.package }}/') + + # https://github.com/bcgov-nr/action-deployer-openshift + deploys: + name: Deploys + needs: [builds] + uses: ./.github/workflows/.deploy.yml + secrets: inherit + with: + build_outputs: ${{ needs.builds.outputs.digest }} + tag: ${{ github.event.number }} + release: ${{ github.event.number }} + test: name: Test - # needs: [builds] + needs: [deploys] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: - token: ${{ secrets.OC_TOKEN }} + oc_token: ${{ secrets.OC_TOKEN }} with: cleanup: helm oc_namespace: ${{ vars.OC_NAMESPACE }} - # packages: backend frontend - - # # https://github.com/bcgov-nr/action-deployer-openshift - # deploys: - # name: Deploys - # needs: [builds] - # uses: ./.github/workflows/.deploy.yml - # secrets: inherit - # with: - # build_outputs: ${{ needs.builds.outputs.digest }} - # tag: ${{ github.event.number }} - # release: ${{ github.event.number }} + packages: backend frontend migrations # validate: # name: Validate From f7edae471ec53c353a5e179b66f9dde698f0cacc Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:07:41 -0800 Subject: [PATCH 26/30] Allow hiding oc_namespace --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 3def6ca2b..fcc0ad587 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -47,10 +47,10 @@ jobs: needs: [deploys] uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close secrets: + oc_namespace: ${{ vars.OC_NAMESPACE }} oc_token: ${{ secrets.OC_TOKEN }} with: cleanup: helm - oc_namespace: ${{ vars.OC_NAMESPACE }} packages: backend frontend migrations # validate: From bf14550d95423584a84f48deba694924e0f8236b Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:29:10 -0800 Subject: [PATCH 27/30] Try non-default workflow folders --- .github/workflows/pr-close.yml | 48 +++++-------------------- .github/workflows/pr-open.yml | 66 +++++++++++++++++----------------- 2 files changed, 42 insertions(+), 72 deletions(-) diff --git a/.github/workflows/pr-close.yml b/.github/workflows/pr-close.yml index 02b701bf1..426ba2709 100644 --- a/.github/workflows/pr-close.yml +++ b/.github/workflows/pr-close.yml @@ -10,42 +10,12 @@ concurrency: cancel-in-progress: true jobs: - # Clean up OpenShift when PR closed, no conditions - cleanup-openshift: - name: Cleanup OpenShift - env: - release: ${{ github.event.repository.name }}-${{ github.event.number }} - runs-on: ubuntu-22.04 - timeout-minutes: 10 - steps: - - name: Remove OpenShift artifacts - run: | - oc login --token=${{ secrets.OC_TOKEN }} --server=${{ vars.OC_SERVER }} - oc project ${{ vars.OC_NAMESPACE }} # Safeguard! - - # If found, then remove - helm status ${{ env.release }} && helm uninstall --no-hooks ${{ env.release }} || \ - echo "Not found: ${{ env.release }}" - - # Remove Bitnami Crunchy PVCs - oc delete pvc data-${{ env.release }}-bitnami-pg-0 || \ - echo "Not found: pvc data-${{ env.release }}-bitnami-pg-0" - - # Add tags to PR image - retags: - name: Promote Images - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' - runs-on: ubuntu-22.04 - permissions: - packages: write - strategy: - matrix: - package: [migrations, backend, frontend] - timeout-minutes: 1 - steps: - - uses: shrink/actions-docker-registry-tag@v4 - with: - registry: ghcr.io - repository: ${{ github.repository }}/${{ matrix.package }} - target: ${{ github.event.number }} - tags: latest + cleanup: + name: Cleanup OpenShift and/or Promote Images + uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-close.yml@main + secrets: + oc_namespace: ${{ vars.OC_NAMESPACE }} + oc_token: ${{ secrets.OC_TOKEN }} + with: + cleanup: helm + packages: backend frontend migrations diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index fcc0ad587..00df26bb4 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,43 +9,43 @@ concurrency: cancel-in-progress: true jobs: - # https://github.com/bcgov-nr/action-builder-ghcr - builds: - name: Builds - runs-on: ubuntu-22.04 - permissions: - packages: write - outputs: - digest: ${{ steps.builds.outputs.digest }} - strategy: - matrix: - package: [migrations, backend, frontend] - timeout-minutes: 10 - steps: - - uses: bcgov-nr/action-builder-ghcr@v2.0.2 - id: builds - with: - keep_versions: 50 - package: ${{ matrix.package }} - tag: ${{ github.event.number }} - tag_fallback: latest - # triggers: ('${{ matrix.package }}/') + # # https://github.com/bcgov-nr/action-builder-ghcr + # builds: + # name: Builds + # runs-on: ubuntu-22.04 + # permissions: + # packages: write + # outputs: + # digest: ${{ steps.builds.outputs.digest }} + # strategy: + # matrix: + # package: [migrations, backend, frontend] + # timeout-minutes: 10 + # steps: + # - uses: bcgov-nr/action-builder-ghcr@v2.0.2 + # id: builds + # with: + # keep_versions: 50 + # package: ${{ matrix.package }} + # tag: ${{ github.event.number }} + # tag_fallback: latest + # # triggers: ('${{ matrix.package }}/') - # https://github.com/bcgov-nr/action-deployer-openshift - deploys: - name: Deploys - needs: [builds] - uses: ./.github/workflows/.deploy.yml - secrets: inherit - with: - build_outputs: ${{ needs.builds.outputs.digest }} - tag: ${{ github.event.number }} - release: ${{ github.event.number }} + # # https://github.com/bcgov-nr/action-deployer-openshift + # deploys: + # name: Deploys + # needs: [builds] + # uses: ./.github/workflows/.deploy.yml + # secrets: inherit + # with: + # build_outputs: ${{ needs.builds.outputs.digest }} + # tag: ${{ github.event.number }} + # release: ${{ github.event.number }} test: name: Test - needs: [deploys] - uses: bcgov-nr/action-support/.github/workflows/.pr-close.yml@feat/pr-close + # needs: [deploys] + uses: bcgov/quickstart-openshift-helpers/test.yml@main secrets: oc_namespace: ${{ vars.OC_NAMESPACE }} oc_token: ${{ secrets.OC_TOKEN }} From 438dad4ec55a70d465177810008db52a413e8889 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:30:20 -0800 Subject: [PATCH 28/30] Try non-default workflow folders --- .github/workflows/pr-open.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 00df26bb4..d1eac5f63 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -46,12 +46,12 @@ jobs: name: Test # needs: [deploys] uses: bcgov/quickstart-openshift-helpers/test.yml@main - secrets: - oc_namespace: ${{ vars.OC_NAMESPACE }} - oc_token: ${{ secrets.OC_TOKEN }} - with: - cleanup: helm - packages: backend frontend migrations + # secrets: + # oc_namespace: ${{ vars.OC_NAMESPACE }} + # oc_token: ${{ secrets.OC_TOKEN }} + # with: + # cleanup: helm + # packages: backend frontend migrations # validate: # name: Validate From 8075d9f785e1470bae549d0e0dfa4d5f5597f40b Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:31:50 -0800 Subject: [PATCH 29/30] Restore workflows --- .github/workflows/pr-open.yml | 141 ++++++++++++++++------------------ 1 file changed, 65 insertions(+), 76 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index d1eac5f63..979bec156 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,87 +9,76 @@ concurrency: cancel-in-progress: true jobs: - # # https://github.com/bcgov-nr/action-builder-ghcr - # builds: - # name: Builds - # runs-on: ubuntu-22.04 - # permissions: - # packages: write - # outputs: - # digest: ${{ steps.builds.outputs.digest }} - # strategy: - # matrix: - # package: [migrations, backend, frontend] - # timeout-minutes: 10 - # steps: - # - uses: bcgov-nr/action-builder-ghcr@v2.0.2 - # id: builds - # with: - # keep_versions: 50 - # package: ${{ matrix.package }} - # tag: ${{ github.event.number }} - # tag_fallback: latest - # # triggers: ('${{ matrix.package }}/') + # https://github.com/bcgov-nr/action-builder-ghcr + builds: + name: Builds + runs-on: ubuntu-22.04 + permissions: + packages: write + outputs: + digest: ${{ steps.builds.outputs.digest }} + strategy: + matrix: + package: [migrations, backend, frontend] + timeout-minutes: 10 + steps: + - uses: bcgov-nr/action-builder-ghcr@v2.0.2 + id: builds + with: + keep_versions: 50 + package: ${{ matrix.package }} + tag: ${{ github.event.number }} + tag_fallback: latest + triggers: ('${{ matrix.package }}/') - # # https://github.com/bcgov-nr/action-deployer-openshift - # deploys: - # name: Deploys - # needs: [builds] - # uses: ./.github/workflows/.deploy.yml - # secrets: inherit - # with: - # build_outputs: ${{ needs.builds.outputs.digest }} - # tag: ${{ github.event.number }} - # release: ${{ github.event.number }} + # https://github.com/bcgov-nr/action-deployer-openshift + deploys: + name: Deploys + needs: [builds] + uses: ./.github/workflows/.deploy.yml + secrets: inherit + with: + build_outputs: ${{ needs.builds.outputs.digest }} + tag: ${{ github.event.number }} + release: ${{ github.event.number }} - test: - name: Test - # needs: [deploys] - uses: bcgov/quickstart-openshift-helpers/test.yml@main - # secrets: - # oc_namespace: ${{ vars.OC_NAMESPACE }} - # oc_token: ${{ secrets.OC_TOKEN }} - # with: - # cleanup: helm - # packages: backend frontend migrations + validate: + name: Validate + needs: [deploys] + if: always() && (!cancelled()) && (!failure()) + env: + DOMAIN: apps.silver.devops.gov.bc.ca + PREFIX: ${{ github.event.repository.name }} + permissions: + pull-requests: write + runs-on: ubuntu-22.04 + steps: + - uses: amannn/action-semantic-pull-request@v5.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # validate: - # name: Validate - # needs: [deploys] - # if: always() && (!cancelled()) && (!failure()) - # env: - # DOMAIN: apps.silver.devops.gov.bc.ca - # PREFIX: ${{ github.event.repository.name }} - # permissions: - # pull-requests: write - # runs-on: ubuntu-22.04 - # steps: - # - uses: amannn/action-semantic-pull-request@v5.4.0 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() + run: | + echo "Please use conventional commits in your PR title and re-run this job." + echo "https://www.conventionalcommits.org/en/v1.0.0/" + exit 1 - # - if: failure() - # run: | - # echo "Please use conventional commits in your PR title and re-run this job." - # echo "https://www.conventionalcommits.org/en/v1.0.0/" - # exit 1 + - uses: bcgov-nr/action-pr-description-add@v1.1.1 + env: + DOMAIN: apps.silver.devops.gov.bc.ca + PREFIX: ${{ github.event.repository.name }} + with: + add_markdown: | + --- - # - uses: bcgov-nr/action-pr-description-add@v1.1.1 - # env: - # DOMAIN: apps.silver.devops.gov.bc.ca - # PREFIX: ${{ github.event.repository.name }} - # with: - # add_markdown: | - # --- + Thanks for the PR! - # Thanks for the PR! + Deployments, as required, will be available below: + - [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}) + - [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api) - # Deployments, as required, will be available below: - # - [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}) - # - [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api) + Please create PRs in draft mode. Mark as ready to enable: + - [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml) - # Please create PRs in draft mode. Mark as ready to enable: - # - [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml) - - # After merge, new images are deployed in: - # - [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml) + After merge, new images are deployed in: + - [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml) From 847a9bc7fe9dc151de60dd738f2dd9eb4f25b13e Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:32:17 -0800 Subject: [PATCH 30/30] Restore workflows --- .github/workflows/analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 28791a77d..3e5b317d7 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -3,8 +3,8 @@ name: Analysis on: push: branches: [main] - # pull_request: - # types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] + pull_request: + types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] schedule: - cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays workflow_dispatch: