From b18f848a924ccf87d3adeef64ef84f83f9e37fd7 Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:53:26 +0300 Subject: [PATCH 1/7] Test Statement Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- apps/codeforafrica/src/pages/index.page.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/codeforafrica/src/pages/index.page.js b/apps/codeforafrica/src/pages/index.page.js index f34fba1d8..928a66b02 100644 --- a/apps/codeforafrica/src/pages/index.page.js +++ b/apps/codeforafrica/src/pages/index.page.js @@ -1,6 +1,7 @@ import Page, { getServerSideProps as sharedGetServerSideProps, } from "./[...slugs].page"; +// Test destroy deployment export async function getServerSideProps(context) { const func = sharedGetServerSideProps.bind(this); From f83bbe7628389571b46ba7d365ae68379a6f4932 Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:10:58 +0300 Subject: [PATCH 2/7] chore: Update codeforafrica-deploy-review-app.yml workflow Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- .github/workflows/codeforafrica-deploy-review-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeforafrica-deploy-review-app.yml b/.github/workflows/codeforafrica-deploy-review-app.yml index 564664616..37267945b 100644 --- a/.github/workflows/codeforafrica-deploy-review-app.yml +++ b/.github/workflows/codeforafrica-deploy-review-app.yml @@ -6,6 +6,7 @@ on: - "apps/codeforafrica/**" - "Dockerfile.codeforafrica" - ".github/workflows/codeforafrica-deploy-review.yml" + types: [opened, reopened, edited, closed, synchronize] concurrency: group: "${{ github.workflow }} @ ${{ github.ref }}" cancel-in-progress: false From 1c52ab06202aedc71355057b70c113856dfcdaff Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:28:45 +0300 Subject: [PATCH 3/7] chore: Remove test destroy deployment statement --- apps/codeforafrica/src/pages/index.page.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/codeforafrica/src/pages/index.page.js b/apps/codeforafrica/src/pages/index.page.js index 928a66b02..f34fba1d8 100644 --- a/apps/codeforafrica/src/pages/index.page.js +++ b/apps/codeforafrica/src/pages/index.page.js @@ -1,7 +1,6 @@ import Page, { getServerSideProps as sharedGetServerSideProps, } from "./[...slugs].page"; -// Test destroy deployment export async function getServerSideProps(context) { const func = sharedGetServerSideProps.bind(this); From 666a6e82562394f55a01bd544d5f5767f828665d Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:49:26 +0300 Subject: [PATCH 4/7] Update .github/workflows/codeforafrica-deploy-review-app.yml Co-authored-by: KEVIN KOECH --- .github/workflows/codeforafrica-deploy-review-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeforafrica-deploy-review-app.yml b/.github/workflows/codeforafrica-deploy-review-app.yml index 37267945b..7bd4bfb9d 100644 --- a/.github/workflows/codeforafrica-deploy-review-app.yml +++ b/.github/workflows/codeforafrica-deploy-review-app.yml @@ -5,7 +5,7 @@ on: paths: - "apps/codeforafrica/**" - "Dockerfile.codeforafrica" - - ".github/workflows/codeforafrica-deploy-review.yml" + - ".github/workflows/codeforafrica-deploy-review-app.yml" types: [opened, reopened, edited, closed, synchronize] concurrency: group: "${{ github.workflow }} @ ${{ github.ref }}" From 9fce9a456943347037144213cdb0f1ed1866502d Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:38:32 +0300 Subject: [PATCH 5/7] Update codeforafrica-deploy-review-app.yml workflow types Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- .github/workflows/codeforafrica-deploy-review-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeforafrica-deploy-review-app.yml b/.github/workflows/codeforafrica-deploy-review-app.yml index 7bd4bfb9d..8b4d8fe23 100644 --- a/.github/workflows/codeforafrica-deploy-review-app.yml +++ b/.github/workflows/codeforafrica-deploy-review-app.yml @@ -6,7 +6,8 @@ on: - "apps/codeforafrica/**" - "Dockerfile.codeforafrica" - ".github/workflows/codeforafrica-deploy-review-app.yml" - types: [opened, reopened, edited, closed, synchronize] + # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened. We need to add closed to the list of activity types to ensure that the workflow runs when a pull request is closed. + types: [opened, reopened, closed, synchronize] concurrency: group: "${{ github.workflow }} @ ${{ github.ref }}" cancel-in-progress: false From 39f29214be1f7f68b95a8a9f8ff63a9049f943f6 Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:00:10 +0300 Subject: [PATCH 6/7] chore: Destroy should also run on merge Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- .github/workflows/codeforafrica-deploy-review-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeforafrica-deploy-review-app.yml b/.github/workflows/codeforafrica-deploy-review-app.yml index 8b4d8fe23..26f688011 100644 --- a/.github/workflows/codeforafrica-deploy-review-app.yml +++ b/.github/workflows/codeforafrica-deploy-review-app.yml @@ -89,7 +89,7 @@ jobs: destroy_review_app: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.event.action == 'closed' + if: github.event_name == 'pull_request' && (github.event.action == 'closed' || github.event.action == 'merged') steps: - name: Destroy review app uses: dokku/github-action@master From 16d14051891c4f54df716229a5264aedc217834a Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:19:02 +0300 Subject: [PATCH 7/7] Test PR merge Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- .github/workflows/codeforafrica-deploy-review-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeforafrica-deploy-review-app.yml b/.github/workflows/codeforafrica-deploy-review-app.yml index 26f688011..809683726 100644 --- a/.github/workflows/codeforafrica-deploy-review-app.yml +++ b/.github/workflows/codeforafrica-deploy-review-app.yml @@ -6,7 +6,7 @@ on: - "apps/codeforafrica/**" - "Dockerfile.codeforafrica" - ".github/workflows/codeforafrica-deploy-review-app.yml" - # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened. We need to add closed to the list of activity types to ensure that the workflow runs when a pull request is closed. + # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened. types: [opened, reopened, closed, synchronize] concurrency: group: "${{ github.workflow }} @ ${{ github.ref }}" @@ -89,7 +89,7 @@ jobs: destroy_review_app: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && (github.event.action == 'closed' || github.event.action == 'merged') + if: github.event_name == 'pull_request' && github.event.action == 'closed' steps: - name: Destroy review app uses: dokku/github-action@master