From 0a1fad6364d972a940b36e4bfa325a3efc074504 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 14:42:29 +1100 Subject: [PATCH 01/49] Drafted the 'on' trigger for the action --- .github/workflows/deploy-demo.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/deploy-demo.yaml diff --git a/.github/workflows/deploy-demo.yaml b/.github/workflows/deploy-demo.yaml new file mode 100644 index 000000000..71dd358bc --- /dev/null +++ b/.github/workflows/deploy-demo.yaml @@ -0,0 +1,18 @@ +name: Deploy to Demo + +on: + pull_request: + branches: + - main + types: + - opened + - reopened + +# jobs: +# build: +# runs-on: ubuntu-latest +# +# steps: + +# DEPLOY_NAME = "Pull Request" +# BUILD_MODE = "demo" From 259e01ac3619d2901d2bbeb81cb96e8a949b52a9 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 14:59:34 +1100 Subject: [PATCH 02/49] Copied code from the deploy production YAML and also formatted deploy production YAML to match --- .github/workflows/deploy-demo.yaml | 49 +++++++++++++++++++++--- .github/workflows/deploy-production.yaml | 3 +- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-demo.yaml b/.github/workflows/deploy-demo.yaml index 71dd358bc..788668bad 100644 --- a/.github/workflows/deploy-demo.yaml +++ b/.github/workflows/deploy-demo.yaml @@ -8,11 +8,50 @@ on: - opened - reopened -# jobs: -# build: -# runs-on: ubuntu-latest -# -# steps: +jobs: + publish: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.11"] + node-version: [18.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Pull latest from submodules + run: git submodule foreach git pull origin stable + # This doesn't update the submodule to the latest commit on the origin; therefore, you should manually do this on a semi-regular basis. + + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install requirements + run: ./install-production.sh + + - name: Build site + env: + BUILD_MODE: production + run: ./build-production.sh + + - name: Configure AWS credentials via OIDC + # if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + # uses: aws-actions/configure-aws-credentials@v2 + # with: + # role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-docs + # aws-region: ap-southeast-2 + + - name: Deploy site + # if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + # env: + # DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} + # run: ./deploy-production.sh # DEPLOY_NAME = "Pull Request" # BUILD_MODE = "demo" diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml index aa0036f6a..977e32545 100644 --- a/.github/workflows/deploy-production.yaml +++ b/.github/workflows/deploy-production.yaml @@ -12,12 +12,13 @@ permissions: jobs: publish: - name: Publish runs-on: ubuntu-latest + strategy: matrix: python-version: ["3.11"] node-version: [18.x] + steps: - name: Checkout repository uses: actions/checkout@v4 From 808f8d6cdfb1e286d90524bcb6dbdcf87550101e Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 15:03:10 +1100 Subject: [PATCH 03/49] Renamed the YAML file --- ...deploy-demo.yaml => deploy-pr-preview.yaml} | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) rename .github/workflows/{deploy-demo.yaml => deploy-pr-preview.yaml} (59%) diff --git a/.github/workflows/deploy-demo.yaml b/.github/workflows/deploy-pr-preview.yaml similarity index 59% rename from .github/workflows/deploy-demo.yaml rename to .github/workflows/deploy-pr-preview.yaml index 788668bad..83afa614f 100644 --- a/.github/workflows/deploy-demo.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -1,4 +1,4 @@ -name: Deploy to Demo +name: Deploy to PR Preview on: pull_request: @@ -37,21 +37,9 @@ jobs: - name: Build site env: - BUILD_MODE: production + BUILD_MODE: demo + DEPLOY_NAME: Pull Request run: ./build-production.sh - - name: Configure AWS credentials via OIDC - # if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' - # uses: aws-actions/configure-aws-credentials@v2 - # with: - # role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-docs - # aws-region: ap-southeast-2 - - name: Deploy site - # if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' - # env: - # DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} - # run: ./deploy-production.sh -# DEPLOY_NAME = "Pull Request" -# BUILD_MODE = "demo" From 1e95a6e7378747ea4677de1bf5447060e31564f9 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 15:18:33 +1100 Subject: [PATCH 04/49] Added 'Comment on PR' step --- .github/workflows/deploy-pr-preview.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 83afa614f..d520882d9 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -43,3 +43,12 @@ jobs: - name: Deploy site + - name: Comment on PR + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{github.event.pull_request.number}} + body: | + Access the preview site at this link. + + [pr-${{github.event.pull_request.number}}-preview.knowledge.dea.ga.gov.au](https://pr-${{github.event.pull_request.number}}-preview.knowledge.dea.ga.gov.au/) + From e073888c34af2d05114d924688320fd32fc89352 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 15:38:57 +1100 Subject: [PATCH 05/49] Refactored slightly --- .github/workflows/deploy-pr-preview.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index d520882d9..b3f444150 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -45,10 +45,12 @@ jobs: - name: Comment on PR uses: peter-evans/create-or-update-comment@v4 + env: + PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview with: issue-number: ${{github.event.pull_request.number}} body: | Access the preview site at this link. - [pr-${{github.event.pull_request.number}}-preview.knowledge.dea.ga.gov.au](https://pr-${{github.event.pull_request.number}}-preview.knowledge.dea.ga.gov.au/) + [$PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) From 50771e7a50820cd068f3b797ff511c408e831ecb Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 16:02:56 +1100 Subject: [PATCH 06/49] Drafted the 'Deploy site' step --- .github/workflows/deploy-pr-preview.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index b3f444150..51df394ff 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -8,6 +8,9 @@ on: - opened - reopened +env: + PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview + jobs: publish: runs-on: ubuntu-latest @@ -42,6 +45,16 @@ jobs: run: ./build-production.sh - name: Deploy site + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'ap-southeast-2' + SOURCE_DIR: 'output' + DEST_DIR: $PR_PREVIEW_SUBDOMAIN - name: Comment on PR uses: peter-evans/create-or-update-comment@v4 @@ -52,5 +65,5 @@ jobs: body: | Access the preview site at this link. - [$PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) + [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) From 902c91def6eb58d6af416f0be6c9b7cf6a03691a Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 16:16:49 +1100 Subject: [PATCH 07/49] Edited the comment content --- .github/workflows/deploy-pr-preview.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 51df394ff..31f316685 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -63,7 +63,9 @@ jobs: with: issue-number: ${{github.event.pull_request.number}} body: | - Access the preview site at this link. + ## View the preview + + **Preview site:** [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) - [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) + **Deploy log:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) From 9ef165677a6849a7ad05cfd90f7385dfaa83c677 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 16:21:55 +1100 Subject: [PATCH 08/49] Improving build script --- .github/workflows/deploy-pr-preview.yaml | 2 +- build-demo.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 31f316685..67a07f680 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -42,7 +42,7 @@ jobs: env: BUILD_MODE: demo DEPLOY_NAME: Pull Request - run: ./build-production.sh + run: ./build-demo.sh - name: Deploy site uses: jakejarvis/s3-sync-action@master diff --git a/build-demo.sh b/build-demo.sh index e0f026997..626c50d49 100755 --- a/build-demo.sh +++ b/build-demo.sh @@ -1,10 +1,6 @@ #!/bin/bash -python -m pip install -r ./docs/requirements.txt - -npm install -g sass - -apt-get install -y pandoc +set -eox pipefail mkdir -p ./output From 46be2198960ddcfc3f55c33e2d5359e85debdbb8 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 16:25:06 +1100 Subject: [PATCH 09/49] Renamed file --- .github/workflows/deploy-pr-preview.yaml | 2 +- build-demo.sh => build-pr-preview.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename build-demo.sh => build-pr-preview.sh (100%) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 67a07f680..2566eacd8 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -42,7 +42,7 @@ jobs: env: BUILD_MODE: demo DEPLOY_NAME: Pull Request - run: ./build-demo.sh + run: ./build-pr-preview.sh - name: Deploy site uses: jakejarvis/s3-sync-action@master diff --git a/build-demo.sh b/build-pr-preview.sh similarity index 100% rename from build-demo.sh rename to build-pr-preview.sh From 446e46044c386c1808cee2adce00fe7c0d6e7ad3 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 16:26:01 +1100 Subject: [PATCH 10/49] Minor rewording --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 2566eacd8..12101e194 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -63,7 +63,7 @@ jobs: with: issue-number: ${{github.event.pull_request.number}} body: | - ## View the preview + ## Preview **Preview site:** [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) From 5e71b62fb1ccee22cf8b9ffe40092bdd2ad75db0 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Tue, 12 Mar 2024 16:27:19 +1100 Subject: [PATCH 11/49] Removed Netlify config file --- netlify.toml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index cfb081ab6..000000000 --- a/netlify.toml +++ /dev/null @@ -1,34 +0,0 @@ -[build] - -command = "./build-demo.sh" -publish = "output" - -[build.environment] - -BUILD_MODE = "demo" - -[context.production] - -ignore = "exit 0" # Never build - -[context.deploy-preview.environment] - -DEPLOY_NAME = "Pull Request" - -[context.demo1.environment] - -DEPLOY_NAME = "Demo 1" - -[context.demo2.environment] - -DEPLOY_NAME = "Demo 2" - -[context.demo3.environment] - -DEPLOY_NAME = "Demo 3" - -[[redirects]] - -from = "/*" -to = "/404-not-found/" -status = 404 From ca3e1ab97dcb3d2493797418934b8a8504d8a257 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 10:08:20 +1100 Subject: [PATCH 12/49] Added a 'preview is building' comment. Now the commenting uses 2 steps --- .github/workflows/deploy-pr-preview.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 12101e194..0775585b7 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -44,6 +44,16 @@ jobs: DEPLOY_NAME: Pull Request run: ./build-pr-preview.sh + - name: "Comment on PR: Preview is building" + id: comment-preview-building + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{github.event.pull_request.number}} + body: | + ## Preview is building ... + + **Deploy log:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + - name: Deploy site uses: jakejarvis/s3-sync-action@master with: @@ -56,14 +66,16 @@ jobs: SOURCE_DIR: 'output' DEST_DIR: $PR_PREVIEW_SUBDOMAIN - - name: Comment on PR + - name: "Comment on PR: Preview is ready" + id: comment-preview-ready uses: peter-evans/create-or-update-comment@v4 env: PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview with: issue-number: ${{github.event.pull_request.number}} + comment-id: ${{ steps.comment-preview-building.outputs.comment-id }} body: | - ## Preview + ## Preview is ready **Preview site:** [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) From c1945d374ee502f54936fc55dcb6b117e4cd76e5 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 10:14:30 +1100 Subject: [PATCH 13/49] Formatted comments using tables --- .github/workflows/deploy-pr-preview.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 0775585b7..51a2bb533 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -51,8 +51,10 @@ jobs: issue-number: ${{github.event.pull_request.number}} body: | ## Preview is building ... - - **Deploy log:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + | | | + | --- | --- | + | **Deploy log:** | [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | - name: Deploy site uses: jakejarvis/s3-sync-action@master @@ -76,8 +78,9 @@ jobs: comment-id: ${{ steps.comment-preview-building.outputs.comment-id }} body: | ## Preview is ready - - **Preview site:** [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) - - **Deploy log:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + | | | + | --- | --- | + | **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) | + | **Deploy log:** | [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | + From c60499390b4811076541bd59e5df3112f879ebed Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 10:17:20 +1100 Subject: [PATCH 14/49] Removed redundant env variable from workflow --- .github/workflows/deploy-pr-preview.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 51a2bb533..a749b7854 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -71,8 +71,6 @@ jobs: - name: "Comment on PR: Preview is ready" id: comment-preview-ready uses: peter-evans/create-or-update-comment@v4 - env: - PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview with: issue-number: ${{github.event.pull_request.number}} comment-id: ${{ steps.comment-preview-building.outputs.comment-id }} From b8593b65fb81dbe214bdb95f1d959c8072b3a466 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 10:19:02 +1100 Subject: [PATCH 15/49] Minor wording in workflow --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index a749b7854..716db137c 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -68,7 +68,7 @@ jobs: SOURCE_DIR: 'output' DEST_DIR: $PR_PREVIEW_SUBDOMAIN - - name: "Comment on PR: Preview is ready" + - name: "Update Comment on PR: Preview is ready" id: comment-preview-ready uses: peter-evans/create-or-update-comment@v4 with: From 8490181dfd136b454d2ae6426bd40cf86caee76a Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 11:29:17 +1100 Subject: [PATCH 16/49] Renamed 'install-production' script since it is now also used in the pr-preview environment --- .github/workflows/deploy-pr-preview.yaml | 2 +- .github/workflows/deploy-production.yaml | 2 +- install-production.sh => install-dependencies.sh | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename install-production.sh => install-dependencies.sh (100%) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 716db137c..a99ec3b27 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -36,7 +36,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install requirements - run: ./install-production.sh + run: ./install-dependencies.sh - name: Build site env: diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml index 977e32545..9c8db1114 100644 --- a/.github/workflows/deploy-production.yaml +++ b/.github/workflows/deploy-production.yaml @@ -35,7 +35,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install requirements - run: ./install-production.sh + run: ./install-dependencies.sh - name: Build site env: diff --git a/install-production.sh b/install-dependencies.sh similarity index 100% rename from install-production.sh rename to install-dependencies.sh From 6f548e8f313366e20feeb6189d9dac213f227d06 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 11:33:48 +1100 Subject: [PATCH 17/49] Simplified code by using env variable --- .github/workflows/deploy-pr-preview.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index a99ec3b27..10b95f52c 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -10,6 +10,7 @@ on: env: PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview + DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} jobs: publish: @@ -54,7 +55,7 @@ jobs: | | | | --- | --- | - | **Deploy log:** | [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | + | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | - name: Deploy site uses: jakejarvis/s3-sync-action@master @@ -80,5 +81,5 @@ jobs: | | | | --- | --- | | **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) | - | **Deploy log:** | [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | + | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | From 5e346f2d5a241b9b9bfacd234dd12dedab3f9d4e Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 11:52:44 +1100 Subject: [PATCH 18/49] Copied OIDC step from production workflow --- .github/workflows/deploy-pr-preview.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 10b95f52c..28595be4d 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -45,6 +45,13 @@ jobs: DEPLOY_NAME: Pull Request run: ./build-pr-preview.sh + - name: Configure AWS credentials via OIDC + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-docs + aws-region: ap-southeast-2 + - name: "Comment on PR: Preview is building" id: comment-preview-building uses: peter-evans/create-or-update-comment@v4 From e7c05e34a11969bad7254474dde5cca2e9e59bc5 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 11:53:41 +1100 Subject: [PATCH 19/49] Deleted 'if' condition on PR Preview OIDC step --- .github/workflows/deploy-pr-preview.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 28595be4d..c82c693a4 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -46,7 +46,6 @@ jobs: run: ./build-pr-preview.sh - name: Configure AWS credentials via OIDC - if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' uses: aws-actions/configure-aws-credentials@v2 with: role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-docs From bf9a55061f87ce3fc0be04fbe89ecb71baff8216 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 12:04:48 +1100 Subject: [PATCH 20/49] Created deploy preview script --- .github/workflows/deploy-pr-preview.yaml | 11 +++-------- deploy-pr-preview.sh | 7 +++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100755 deploy-pr-preview.sh diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index c82c693a4..14cf01ed4 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -64,16 +64,11 @@ jobs: | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | - name: Deploy site - uses: jakejarvis/s3-sync-action@master - with: - args: --acl public-read --follow-symlinks --delete + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' env: - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: 'ap-southeast-2' - SOURCE_DIR: 'output' + DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} DEST_DIR: $PR_PREVIEW_SUBDOMAIN + run: ./deploy-production.sh - name: "Update Comment on PR: Preview is ready" id: comment-preview-ready diff --git a/deploy-pr-preview.sh b/deploy-pr-preview.sh new file mode 100755 index 000000000..13e06658f --- /dev/null +++ b/deploy-pr-preview.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Deploy to S3 and invalidate the CloudFront distribution + +python -m pip install awscli +aws s3 sync --delete output s3://docs.dea.ga.gov.au +aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/*' From 5f70420d5ecdc27c50aa42489768e867be5176da Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 12:05:54 +1100 Subject: [PATCH 21/49] Fixed one error in code --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 14cf01ed4..37a0b3246 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -68,7 +68,7 @@ jobs: env: DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} DEST_DIR: $PR_PREVIEW_SUBDOMAIN - run: ./deploy-production.sh + run: ./deploy-pr-preview.sh - name: "Update Comment on PR: Preview is ready" id: comment-preview-ready From cd728d9a8c6ccf3f4923d1e0ffb4edd3eb73e8f7 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Wed, 13 Mar 2024 12:06:31 +1100 Subject: [PATCH 22/49] Removed 'if' condition in workflow --- .github/workflows/deploy-pr-preview.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 37a0b3246..49592a689 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -64,7 +64,6 @@ jobs: | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | - name: Deploy site - if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' env: DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} DEST_DIR: $PR_PREVIEW_SUBDOMAIN From 0aa46935fbd1091d2592861c36a8c7be5803e923 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 16:12:55 +1100 Subject: [PATCH 23/49] Trial setup of PR Previews --- .github/workflows/deploy-pr-preview.yaml | 11 +++++------ deploy-pr-preview.sh | 7 ------- 2 files changed, 5 insertions(+), 13 deletions(-) delete mode 100755 deploy-pr-preview.sh diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 49592a689..86947209d 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -11,6 +11,7 @@ on: env: PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + PR_PREVIEW_BUCKET: s3://khpreview.dea.ga.gov.au jobs: publish: @@ -48,7 +49,7 @@ jobs: - name: Configure AWS credentials via OIDC uses: aws-actions/configure-aws-credentials@v2 with: - role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-docs + role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-knowledge-hub-prs aws-region: ap-southeast-2 - name: "Comment on PR: Preview is building" @@ -64,10 +65,8 @@ jobs: | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | - name: Deploy site - env: - DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} - DEST_DIR: $PR_PREVIEW_SUBDOMAIN - run: ./deploy-pr-preview.sh + run: | + aws s3 sync --delete output "$PR_PREVIEW_BUCKET/$PR_PREVIEW_SUBDOMAIN" - name: "Update Comment on PR: Preview is ready" id: comment-preview-ready @@ -80,6 +79,6 @@ jobs: | | | | --- | --- | - | **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) | + | **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.khpreview.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.khpreview.dea.ga.gov.au/) | | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | diff --git a/deploy-pr-preview.sh b/deploy-pr-preview.sh deleted file mode 100755 index 13e06658f..000000000 --- a/deploy-pr-preview.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Deploy to S3 and invalidate the CloudFront distribution - -python -m pip install awscli -aws s3 sync --delete output s3://docs.dea.ga.gov.au -aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/*' From f44cc8a9bef660a831e73bceedd13198173ba906 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 16:36:46 +1100 Subject: [PATCH 24/49] Allow getting OIDC creds --- .github/workflows/deploy-pr-preview.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 86947209d..13f71076a 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -13,6 +13,9 @@ env: DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} PR_PREVIEW_BUCKET: s3://khpreview.dea.ga.gov.au +permissions: + id-token: write # For requesting the JWT used by OIDC Authentication + jobs: publish: runs-on: ubuntu-latest From d073abec305313c07b9f7d4469cd1ec85bec8d38 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 16:42:13 +1100 Subject: [PATCH 25/49] Run PR Action on Synchronize as well --- .github/workflows/deploy-pr-preview.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 13f71076a..e61fa9bac 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -4,9 +4,6 @@ on: pull_request: branches: - main - types: - - opened - - reopened env: PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview From ae032f5c0632a10c90ae914a1a2a221c52799d77 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 16:55:07 +1100 Subject: [PATCH 26/49] Fix PR comment posting from Actions --- .github/workflows/deploy-pr-preview.yaml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index e61fa9bac..50a47c1ff 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -12,6 +12,8 @@ env: permissions: id-token: write # For requesting the JWT used by OIDC Authentication + issues: write + pull-requests: write jobs: publish: @@ -47,18 +49,28 @@ jobs: run: ./build-pr-preview.sh - name: Configure AWS credentials via OIDC - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-knowledge-hub-prs aws-region: ap-southeast-2 + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: KH Preview + - name: "Comment on PR: Preview is building" id: comment-preview-building uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace body: | - ## Preview is building ... + ## KH Preview is uploading ... | | | | --- | --- | @@ -73,9 +85,10 @@ jobs: uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} - comment-id: ${{ steps.comment-preview-building.outputs.comment-id }} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace body: | - ## Preview is ready + ## KH Preview is ready | | | | --- | --- | From f72319b1f2c616e7cc3e6ab62204e92fb0a5f8d9 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 17:04:18 +1100 Subject: [PATCH 27/49] Fix GitHub Comment templating --- .github/workflows/deploy-pr-preview.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 50a47c1ff..1bb3eec3e 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -74,7 +74,7 @@ jobs: | | | | --- | --- | - | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | + | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | - name: Deploy site run: | @@ -92,6 +92,6 @@ jobs: | | | | --- | --- | - | **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.khpreview.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.khpreview.dea.ga.gov.au/) | - | **Deploy log:** | [View the log]($DEPLOY_LOG_URL) | + | **Preview site:** | [${{ PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au](https://${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au/) | + | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | From 19900d2ed0264eae554ca6ac5294b783026b8447 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 19:54:08 +1100 Subject: [PATCH 28/49] Fix GH Workflow file --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 1bb3eec3e..f8676059b 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -92,6 +92,6 @@ jobs: | | | | --- | --- | - | **Preview site:** | [${{ PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au](https://${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au/) | + | **Preview site:** | [${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au](https://${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au/) | | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | From bc802d3005443939e18b05128ccce6026231e9ac Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 19:58:08 +1100 Subject: [PATCH 29/49] Update PR Preview build domain --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 8cf025730..64e35e37c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,6 +11,7 @@ "git_branch": os.environ.get("BRANCH"), "local_enable_redirects": os.environ.get("LOCAL_ENABLE_REDIRECTS"), "local_enable_tags": os.environ.get("LOCAL_ENABLE_TAGS"), + "pr_preview_subdomain": os.environ.get("PR_PREVIEW_SUBDOMAIN"), } project = "DEA Knowledge Hub" @@ -50,6 +51,7 @@ if environment["build_mode"] == "production": html_baseurl = "https://knowledge.dea.ga.gov.au/" elif environment["build_mode"] == "demo": html_baseurl = f"https://{environment['git_branch']}--dea-docs.netlify.app/" +elif environment["build_mode"] == "pr-preview": html_baseurl = f"https://{environment['pr_preview_subdomain']}.khpreview.dea.ga.gov.au/" else: html_baseurl = "" html_permalinks = False From bec1dafb7f4ca9645cc242b6392839ff26ebb895 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 21:33:28 +1100 Subject: [PATCH 30/49] Tweak comments and cache build deps --- .github/workflows/deploy-pr-preview.yaml | 53 ++++++++++++------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index f8676059b..db9e96527 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -25,6 +25,28 @@ jobs: node-version: [18.x] steps: + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: PR Preview + + - name: "Comment on PR: Preview is building" + id: comment-preview-building + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{github.event.pull_request.number}} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace + body: | + ## ⏳ PR Preview is building... + + | | | + | --- | --- | + | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | + - name: Checkout repository uses: actions/checkout@v4 with: @@ -35,16 +57,17 @@ jobs: # This doesn't update the submodule to the latest commit on the origin; therefore, you should manually do this on a semi-regular basis. - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' # Cache the deps we install with pip - name: Install requirements run: ./install-dependencies.sh - name: Build site env: - BUILD_MODE: demo + BUILD_MODE: pr-preview DEPLOY_NAME: Pull Request run: ./build-pr-preview.sh @@ -54,29 +77,7 @@ jobs: role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-knowledge-hub-prs aws-region: ap-southeast-2 - - name: Find Comment - uses: peter-evans/find-comment@v3 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: KH Preview - - - name: "Comment on PR: Preview is building" - id: comment-preview-building - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{github.event.pull_request.number}} - comment-id: ${{ steps.fc.outputs.comment-id }} - edit-mode: replace - body: | - ## KH Preview is uploading ... - - | | | - | --- | --- | - | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | - - - name: Deploy site + - name: Deploy preview site run: | aws s3 sync --delete output "$PR_PREVIEW_BUCKET/$PR_PREVIEW_SUBDOMAIN" @@ -88,7 +89,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## KH Preview is ready + ## ✅ PH Preview is ready | | | | --- | --- | From c9cc7713a66eb257b71417e37556dc2c1f922960 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 13 Mar 2024 22:02:32 +1100 Subject: [PATCH 31/49] Fix Typo --- .github/workflows/deploy-pr-preview.yaml | 2 +- docs/conf.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index db9e96527..f4e770e86 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -89,7 +89,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## ✅ PH Preview is ready + ## ✅ PR Preview is ready | | | | --- | --- | diff --git a/docs/conf.py b/docs/conf.py index 64e35e37c..715ce4332 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -157,4 +157,3 @@ suppress_warnings = [ # "etoc.toctree" ] - From 48be7186b1c678da565b5aaa1955da072741a5c9 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 10:11:27 +1100 Subject: [PATCH 32/49] Replaced emojis with shortcodes --- .github/workflows/deploy-pr-preview.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index f4e770e86..426570140 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -41,7 +41,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## ⏳ PR Preview is building... + ## :hourglass: PR Preview is building... | | | | --- | --- | @@ -89,7 +89,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## ✅ PR Preview is ready + ## :heavy_check_mark: PR Preview is ready | | | | --- | --- | From 25eec5635f3fff2c93fe243c049c5273ed7d25e2 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 10:18:26 +1100 Subject: [PATCH 33/49] Converted Markdown tables to HTML to remove empty header row --- .github/workflows/deploy-pr-preview.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 426570140..ace304797 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -43,9 +43,12 @@ jobs: body: | ## :hourglass: PR Preview is building... - | | | - | --- | --- | - | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | + + + + + +
Deploy log:View the log
- name: Checkout repository uses: actions/checkout@v4 @@ -91,8 +94,14 @@ jobs: body: | ## :heavy_check_mark: PR Preview is ready - | | | - | --- | --- | - | **Preview site:** | [${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au](https://${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au/) | - | **Deploy log:** | [View the log](${{ env.DEPLOY_LOG_URL }}) | + + + + + + + + + +
Preview site:${{ env.PR_PREVIEW_SUBDOMAIN }}.khpreview.dea.ga.gov.au
Deploy log:View the log
From 315e0bad8ac58a1bff06c1817ddab1376bd8ba6e Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 10:18:57 +1100 Subject: [PATCH 34/49] Minor punctuation --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index ace304797..963c1efeb 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -41,7 +41,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :hourglass: PR Preview is building... + ## :hourglass: PR Preview is building ... From 7e43b2da29d3de3f277058592ac990a749749264 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 10:22:46 +1100 Subject: [PATCH 35/49] Wording of comment --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 963c1efeb..172582360 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -63,7 +63,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' # Cache the deps we install with pip + cache: 'pip' # Use pip to cache the installed dependencies - name: Install requirements run: ./install-dependencies.sh From 6fb8e6fdcdd5e51ca0bd6850ac9219ffe77d7e62 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:09:32 +1100 Subject: [PATCH 36/49] Removed 'demo' build mode and its accompanying logic --- .env.example | 2 +- docs/_modules/deploy_banner.py | 11 +---------- docs/_modules/utilities.py | 2 +- docs/conf.py | 7 +++---- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.env.example b/.env.example index 49f0fc670..0025a98cf 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -BUILD_MODE=local # local / demo / production +BUILD_MODE=local # local / pr-preview / production LOCAL_ENABLE_REDIRECTS=Yes LOCAL_ENABLE_TAGS=Yes diff --git a/docs/_modules/deploy_banner.py b/docs/_modules/deploy_banner.py index 7124b364f..c507233a3 100644 --- a/docs/_modules/deploy_banner.py +++ b/docs/_modules/deploy_banner.py @@ -1,9 +1,7 @@ import os def banner(): - git_branch = os.environ.get("BRANCH") deploy_name = os.environ.get("DEPLOY_NAME") - pull_request = os.environ.get("PULL_REQUEST") review_id = os.environ.get("REVIEW_ID") deploy_id = os.environ.get("DEPLOY_ID") @@ -11,12 +9,5 @@ def banner(): github_url = "https://github.com/GeoscienceAustralia/dea-knowledge-hub" deploy_logs_url = "https://app.netlify.com/sites/dea-docs/deploys" - pull_request_banner = f'You are viewing {deploy_name} #{review_id}, not the official DEA Knowledge Hub. View the Deploy log or Pull request.' - - demo_banner = f'You are viewing {deploy_name}, not the official DEA Knowledge Hub. View the Deploy logs or Git branch.' - - if pull_request == "true": - return pull_request_banner - else: - return demo_banner + return f'You are viewing {deploy_name} #{review_id}, not the official DEA Knowledge Hub. View the Deploy log or Pull request.' diff --git a/docs/_modules/utilities.py b/docs/_modules/utilities.py index 192c62a0a..8981131a1 100644 --- a/docs/_modules/utilities.py +++ b/docs/_modules/utilities.py @@ -10,7 +10,7 @@ def current_year(): def optional_exclude_pattern(environment_variable, exclude_pattern): if ( os.environ.get(environment_variable) == "No" - and not os.environ.get("BUILD_MODE") in ["demo", "production"] + and not os.environ.get("BUILD_MODE") in ["pr-preview", "production"] ): return [exclude_pattern] else: diff --git a/docs/conf.py b/docs/conf.py index 715ce4332..661f2f0c6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,7 +50,6 @@ language = "en" if environment["build_mode"] == "production": html_baseurl = "https://knowledge.dea.ga.gov.au/" -elif environment["build_mode"] == "demo": html_baseurl = f"https://{environment['git_branch']}--dea-docs.netlify.app/" elif environment["build_mode"] == "pr-preview": html_baseurl = f"https://{environment['pr_preview_subdomain']}.khpreview.dea.ga.gov.au/" else: html_baseurl = "" @@ -89,7 +88,7 @@ external_toc_path = "table_of_contents.yaml" if ( - environment["build_mode"] in ["demo", "production"] + environment["build_mode"] in ["pr-preview", "production"] or environment["local_enable_redirects"] == "Yes" ): rediraffe_redirects = utilities.source_redirects("_redirects/*.txt") @@ -114,7 +113,7 @@ notfound_urls_prefix = "" tags_create_tags = ( - environment["build_mode"] in ["demo", "production"] + environment["build_mode"] in ["pr-preview", "production"] or environment["local_enable_tags"] == "Yes" ) @@ -143,7 +142,7 @@ }, } -if environment["build_mode"] == "demo": +if environment["build_mode"] == "pr-preview": html_theme_options["announcement"] = deploy_banner.banner() html_context = { From 01e93df58484a0449f0da20d189d5ab63bb74a45 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:15:51 +1100 Subject: [PATCH 37/49] Editing the env variables and preview banner --- .github/workflows/deploy-pr-preview.yaml | 8 ++++---- docs/_modules/deploy_banner.py | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 172582360..7cdddc48d 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -7,7 +7,7 @@ on: env: PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview - DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + PR_PREVIEW_DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} PR_PREVIEW_BUCKET: s3://khpreview.dea.ga.gov.au permissions: @@ -46,7 +46,7 @@ jobs:
- +
Deploy log:View the logView the log
@@ -71,7 +71,7 @@ jobs: - name: Build site env: BUILD_MODE: pr-preview - DEPLOY_NAME: Pull Request + PULL_REQUEST_NUMBER: ${{github.event.pull_request.number}} run: ./build-pr-preview.sh - name: Configure AWS credentials via OIDC @@ -101,7 +101,7 @@ jobs: Deploy log: - View the log + View the log diff --git a/docs/_modules/deploy_banner.py b/docs/_modules/deploy_banner.py index c507233a3..bd0cebc47 100644 --- a/docs/_modules/deploy_banner.py +++ b/docs/_modules/deploy_banner.py @@ -1,13 +1,11 @@ import os def banner(): - deploy_name = os.environ.get("DEPLOY_NAME") - review_id = os.environ.get("REVIEW_ID") - deploy_id = os.environ.get("DEPLOY_ID") + pull_request_number = os.environ.get("PULL_REQUEST_NUMBER") + deploy_log_url = os.environ.get("PR_PREVIEW_DEPLOY_LOG_URL") knowledge_hub_url = "https://knowledge.dea.ga.gov.au/" github_url = "https://github.com/GeoscienceAustralia/dea-knowledge-hub" - deploy_logs_url = "https://app.netlify.com/sites/dea-docs/deploys" - return f'You are viewing {deploy_name} #{review_id}, not the official DEA Knowledge Hub. View the Deploy log or Pull request.' + return f'You are viewing Pull Request #{pull_request_number}, not the official DEA Knowledge Hub. View the Pull request or Deploy log.' From ff79ca49dcc22c8796e5fab6bfa92a16e4b47df0 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:17:24 +1100 Subject: [PATCH 38/49] Renamed 'deploy_banner' python module --- docs/_modules/{deploy_banner.py => pr_preview.py} | 0 docs/conf.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename docs/_modules/{deploy_banner.py => pr_preview.py} (100%) diff --git a/docs/_modules/deploy_banner.py b/docs/_modules/pr_preview.py similarity index 100% rename from docs/_modules/deploy_banner.py rename to docs/_modules/pr_preview.py diff --git a/docs/conf.py b/docs/conf.py index 661f2f0c6..93cbd100d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,7 +4,7 @@ sys.path.insert(0, os.path.abspath('.')) from _modules import utilities from _modules import mock_imports -from _modules import deploy_banner +from _modules import pr_preview environment = { "build_mode": os.environ.get("BUILD_MODE"), @@ -143,7 +143,7 @@ } if environment["build_mode"] == "pr-preview": - html_theme_options["announcement"] = deploy_banner.banner() + html_theme_options["announcement"] = pr_preview.banner() html_context = { "default_mode": "light", From 589e2b7474c960c36986570acc75d1d71d0322cf Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:18:44 +1100 Subject: [PATCH 39/49] Wording on banner --- docs/_modules/pr_preview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_modules/pr_preview.py b/docs/_modules/pr_preview.py index bd0cebc47..d7f99e5bb 100644 --- a/docs/_modules/pr_preview.py +++ b/docs/_modules/pr_preview.py @@ -7,5 +7,5 @@ def banner(): knowledge_hub_url = "https://knowledge.dea.ga.gov.au/" github_url = "https://github.com/GeoscienceAustralia/dea-knowledge-hub" - return f'You are viewing Pull Request #{pull_request_number}, not the official DEA Knowledge Hub. View the Pull request or Deploy log.' + return f'You are viewing PR Preview #{pull_request_number}, not the official DEA Knowledge Hub. View the Pull request or Deploy log.' From ff7f67036d9ea0d6a5ed0e95e8e75e63cab980d1 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:26:36 +1100 Subject: [PATCH 40/49] Changed the emojis to be less colourful --- .github/workflows/deploy-pr-preview.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 7cdddc48d..bb7a7d7c3 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -41,7 +41,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :hourglass: PR Preview is building ... + ## :speech_balloon: PR Preview is building ... @@ -92,7 +92,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :heavy_check_mark: PR Preview is ready + ## :white_check_mark: PR Preview is ready
From 64ee9b7f7143c14b1cef170c7524a4c7917f0403 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:32:29 +1100 Subject: [PATCH 41/49] Minor refactor to pull request number env variable --- .github/workflows/deploy-pr-preview.yaml | 2 +- docs/_modules/pr_preview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index bb7a7d7c3..3c0528580 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -6,6 +6,7 @@ on: - main env: + PR_PREVIEW_PULL_REQUEST_NUMBER: ${{github.event.pull_request.number}} PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview PR_PREVIEW_DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} PR_PREVIEW_BUCKET: s3://khpreview.dea.ga.gov.au @@ -71,7 +72,6 @@ jobs: - name: Build site env: BUILD_MODE: pr-preview - PULL_REQUEST_NUMBER: ${{github.event.pull_request.number}} run: ./build-pr-preview.sh - name: Configure AWS credentials via OIDC diff --git a/docs/_modules/pr_preview.py b/docs/_modules/pr_preview.py index d7f99e5bb..b218ea3b1 100644 --- a/docs/_modules/pr_preview.py +++ b/docs/_modules/pr_preview.py @@ -1,7 +1,7 @@ import os def banner(): - pull_request_number = os.environ.get("PULL_REQUEST_NUMBER") + pull_request_number = os.environ.get("PR_PREVIEW_PULL_REQUEST_NUMBER") deploy_log_url = os.environ.get("PR_PREVIEW_DEPLOY_LOG_URL") knowledge_hub_url = "https://knowledge.dea.ga.gov.au/" From ea788aa190f7708cdb494fe829ffbf9b9e188a60 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:38:46 +1100 Subject: [PATCH 42/49] Renaming some Github Action steps --- .github/workflows/deploy-pr-preview.yaml | 4 ++-- .github/workflows/deploy-production.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 3c0528580..4824e2b79 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -26,7 +26,7 @@ jobs: node-version: [18.x] steps: - - name: Find Comment + - name: Find Comment on PR uses: peter-evans/find-comment@v3 id: fc with: @@ -66,7 +66,7 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'pip' # Use pip to cache the installed dependencies - - name: Install requirements + - name: Install dependencies run: ./install-dependencies.sh - name: Build site diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml index 9c8db1114..b61f2b798 100644 --- a/.github/workflows/deploy-production.yaml +++ b/.github/workflows/deploy-production.yaml @@ -34,7 +34,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install requirements + - name: Install dependencies run: ./install-dependencies.sh - name: Build site From 383d707b8b498a3f72fcdbcbc375339c2cacb075 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:43:19 +1100 Subject: [PATCH 43/49] Added the Pull Request Number to the comment titles --- .github/workflows/deploy-pr-preview.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 4824e2b79..8673217a6 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -26,7 +26,7 @@ jobs: node-version: [18.x] steps: - - name: Find Comment on PR + - name: Find Comment uses: peter-evans/find-comment@v3 id: fc with: @@ -34,7 +34,7 @@ jobs: comment-author: 'github-actions[bot]' body-includes: PR Preview - - name: "Comment on PR: Preview is building" + - name: "Comment: PR Preview #${{github.event.pull_request.number}} is building" id: comment-preview-building uses: peter-evans/create-or-update-comment@v4 with: @@ -42,7 +42,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :speech_balloon: PR Preview is building ... + ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is building ...
@@ -84,7 +84,7 @@ jobs: run: | aws s3 sync --delete output "$PR_PREVIEW_BUCKET/$PR_PREVIEW_SUBDOMAIN" - - name: "Update Comment on PR: Preview is ready" + - name: "Update Comment: PR Preview #${{github.event.pull_request.number}} is ready" id: comment-preview-ready uses: peter-evans/create-or-update-comment@v4 with: @@ -92,7 +92,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :white_check_mark: PR Preview is ready + ## :white_check_mark: PR Preview #${{github.event.pull_request.number}} is ready
From fcf5ab38611db32b67092a45e4fc44aea1144eeb Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:47:47 +1100 Subject: [PATCH 44/49] Disabled the automatic pull request hashtag link in Github markdown --- .github/workflows/deploy-pr-preview.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 8673217a6..01876e5ed 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -42,7 +42,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is building ... + ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is building ...
@@ -92,7 +92,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :white_check_mark: PR Preview #${{github.event.pull_request.number}} is ready + ## :white_check_mark: PR Preview #${{github.event.pull_request.number}} is ready
From 070574cfed1a7acc1e362334945687c3343b795b Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:48:29 +1100 Subject: [PATCH 45/49] Minor wording --- .github/workflows/deploy-pr-preview.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 01876e5ed..835bc2790 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -34,15 +34,15 @@ jobs: comment-author: 'github-actions[bot]' body-includes: PR Preview - - name: "Comment: PR Preview #${{github.event.pull_request.number}} is building" - id: comment-preview-building + - name: "Comment: PR Preview #${{github.event.pull_request.number}} is deploying" + id: comment-preview-deploying uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: | - ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is building ... + ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is deploying ...
From d5cae4de157fed68468f0136f73be8e0fbd2c237 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:49:21 +1100 Subject: [PATCH 46/49] Tidying use of step IDs --- .github/workflows/deploy-pr-preview.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 835bc2790..09fd07a5b 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -28,18 +28,17 @@ jobs: steps: - name: Find Comment uses: peter-evans/find-comment@v3 - id: fc + id: find-comment with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: PR Preview - name: "Comment: PR Preview #${{github.event.pull_request.number}} is deploying" - id: comment-preview-deploying uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} - comment-id: ${{ steps.fc.outputs.comment-id }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is deploying ... @@ -85,11 +84,10 @@ jobs: aws s3 sync --delete output "$PR_PREVIEW_BUCKET/$PR_PREVIEW_SUBDOMAIN" - name: "Update Comment: PR Preview #${{github.event.pull_request.number}} is ready" - id: comment-preview-ready uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} - comment-id: ${{ steps.fc.outputs.comment-id }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | ## :white_check_mark: PR Preview #${{github.event.pull_request.number}} is ready From c31f6c1b222eb7156d0a117e81ec542fa050db4a Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:58:36 +1100 Subject: [PATCH 47/49] Made emojis more colourful and used different emojis --- .github/workflows/deploy-pr-preview.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 09fd07a5b..20c09fd6b 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -41,7 +41,7 @@ jobs: comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - ## :speech_balloon: PR Preview #${{github.event.pull_request.number}} is deploying ... + ## :hourglass: PR Preview #${{github.event.pull_request.number}} is deploying ...
@@ -90,7 +90,7 @@ jobs: comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - ## :white_check_mark: PR Preview #${{github.event.pull_request.number}} is ready + ## :star2: PR Preview #${{github.event.pull_request.number}} is ready
From 760a6b102705d03db11804b613457d0eaebed817 Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 11:59:07 +1100 Subject: [PATCH 48/49] Minor punctuation --- .github/workflows/deploy-pr-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index 20c09fd6b..e9e9f4904 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -90,7 +90,7 @@ jobs: comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - ## :star2: PR Preview #${{github.event.pull_request.number}} is ready + ## :star2: PR Preview #${{github.event.pull_request.number}} is ready!
From d2b0e76ab7ec8e15d8c216b23fc3141c5d8a522c Mon Sep 17 00:00:00 2001 From: Benji Glitsos Date: Thu, 14 Mar 2024 12:23:23 +1100 Subject: [PATCH 49/49] Removed issue numbers from comment titles because they were too visually 'busy' --- .github/workflows/deploy-pr-preview.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml index e9e9f4904..9cde7df9d 100644 --- a/.github/workflows/deploy-pr-preview.yaml +++ b/.github/workflows/deploy-pr-preview.yaml @@ -34,14 +34,14 @@ jobs: comment-author: 'github-actions[bot]' body-includes: PR Preview - - name: "Comment: PR Preview #${{github.event.pull_request.number}} is deploying" + - name: "Comment: PR Preview is deploying" uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - ## :hourglass: PR Preview #${{github.event.pull_request.number}} is deploying ... + ## :hourglass: PR Preview is deploying ...
@@ -83,14 +83,14 @@ jobs: run: | aws s3 sync --delete output "$PR_PREVIEW_BUCKET/$PR_PREVIEW_SUBDOMAIN" - - name: "Update Comment: PR Preview #${{github.event.pull_request.number}} is ready" + - name: "Update Comment: PR Preview is ready" uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.pull_request.number}} comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - ## :star2: PR Preview #${{github.event.pull_request.number}} is ready! + ## :star2: PR Preview is ready!