From 9dd8b276b18d73ba336b4e39f9a7ede39aa67e9e Mon Sep 17 00:00:00 2001 From: atteggiani Date: Wed, 8 Nov 2023 10:36:06 +1100 Subject: [PATCH 1/4] Added exclamation mark in homepage to test deployment --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index eaee2e427..6f0b2db20 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,7 +6,7 @@ hide:

-
Welcome to ACCESS-Hive!
+
Welcome to ACCESS-Hive!!
The open portal for the ACCESS user community, hosted by ACCESS-NRI
From ff1134b6e6af3df8c868c5ea3ad9892ff2a87b8a Mon Sep 17 00:00:00 2001 From: atteggiani Date: Wed, 8 Nov 2023 11:11:22 +1100 Subject: [PATCH 2/4] Added deployment through actions --- .github/workflows/create_pr_preview.yml | 10 +++++-- .../workflows/deploy_development_website.yml | 8 ++++- .github/workflows/publish.yml | 30 +++++-------------- .github/workflows/remove_pr_preview.yml | 12 ++++++-- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/workflows/create_pr_preview.yml b/.github/workflows/create_pr_preview.yml index 5246b777d..a870c3aea 100644 --- a/.github/workflows/create_pr_preview.yml +++ b/.github/workflows/create_pr_preview.yml @@ -17,7 +17,7 @@ env: TARGET_BRANCH: gh-pages jobs: - build-and-deploy-preview: + build-and-deploy-pr-preview: runs-on: ubuntu-latest steps: - name: Checkout @@ -43,7 +43,13 @@ jobs: commit-message: Deploy preview for PR ${{ env.PR }} 🛫 force: false - # - name: Deploy to Github pages + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: website + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v2 - name: Get date run: echo "DATE=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV diff --git a/.github/workflows/deploy_development_website.yml b/.github/workflows/deploy_development_website.yml index c70d7d61d..f454a1776 100644 --- a/.github/workflows/deploy_development_website.yml +++ b/.github/workflows/deploy_development_website.yml @@ -42,4 +42,10 @@ jobs: commit-message: Deploy development website. 🛫 force: false - # - name: Deploy to Github pages \ No newline at end of file + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: website + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f33f53a67..af308c52a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,25 +43,11 @@ jobs: clean-exclude: | pr-preview/ development_website/ - - # deploy: - # needs: build - # environment: - # name: github-pages - # url: ${{ steps.deployment.outputs.page_url }} - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # ref: 'gh-pages' - # - name: Setup Pages - # uses: actions/configure-pages@v3 - # - name: Upload artifact - # uses: actions/upload-pages-artifact@v2 - # with: - # # Upload entire repository - # path: '.' - # - name: Deploy to GitHub Pages - # id: deployment - # uses: actions/deploy-pages@v2 + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: website + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/.github/workflows/remove_pr_preview.yml b/.github/workflows/remove_pr_preview.yml index 2965b0ebb..2392e56f1 100644 --- a/.github/workflows/remove_pr_preview.yml +++ b/.github/workflows/remove_pr_preview.yml @@ -43,7 +43,13 @@ jobs: git commit -m "Deleted '${{ env.TARGET_FOLDER }}' folder." git push origin ${{ env.TARGET_BRANCH }} - # - name: Deploy to Github-pages + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: '.' + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v2 - name: Get date run: echo "DATE=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV @@ -53,7 +59,7 @@ jobs: with: header: pr-preview number: ${{ github.event.number }} - message: "\ + message: | PR Preview :---: @@ -61,4 +67,4 @@ jobs: 🛬 Preview removed because the pull request was closed. ${{ env.DATE }} - " \ No newline at end of file + \ No newline at end of file From 1b17f69733c49017fd1204a424ab5665ee277d5b Mon Sep 17 00:00:00 2001 From: atteggiani Date: Wed, 8 Nov 2023 11:17:08 +1100 Subject: [PATCH 3/4] changed permissions to id-token --- .github/workflows/create_pr_preview.yml | 4 ++++ .github/workflows/deploy_development_website.yml | 4 ++++ .github/workflows/publish.yml | 1 + .github/workflows/remove_pr_preview.yml | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/.github/workflows/create_pr_preview.yml b/.github/workflows/create_pr_preview.yml index a870c3aea..19eb3a694 100644 --- a/.github/workflows/create_pr_preview.yml +++ b/.github/workflows/create_pr_preview.yml @@ -7,6 +7,10 @@ on: - reopened - synchronize +permissions: + contents: write + id-token: write + concurrency: group: preview-${{ github.event.number }} cancel-in-progress: true diff --git a/.github/workflows/deploy_development_website.yml b/.github/workflows/deploy_development_website.yml index f454a1776..4561941cc 100644 --- a/.github/workflows/deploy_development_website.yml +++ b/.github/workflows/deploy_development_website.yml @@ -7,6 +7,10 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + contents: write + id-token: write + concurrency: group: deploy-development cancel-in-progress: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af308c52a..e49c5542c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,7 @@ on: permissions: contents: write + id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. diff --git a/.github/workflows/remove_pr_preview.yml b/.github/workflows/remove_pr_preview.yml index 2392e56f1..331a03f12 100644 --- a/.github/workflows/remove_pr_preview.yml +++ b/.github/workflows/remove_pr_preview.yml @@ -5,6 +5,10 @@ on: types: - closed +permissions: + contents: write + id-token: write + concurrency: group: preview-${{ github.ref }} cancel-in-progress: true From 254bf3af839da36f24266bb0f5326f3299f98e89 Mon Sep 17 00:00:00 2001 From: atteggiani Date: Wed, 8 Nov 2023 11:24:12 +1100 Subject: [PATCH 4/4] Added write permission for pages --- .github/workflows/create_pr_preview.yml | 1 + .github/workflows/deploy_development_website.yml | 1 + .github/workflows/publish.yml | 1 + .github/workflows/remove_pr_preview.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/create_pr_preview.yml b/.github/workflows/create_pr_preview.yml index 19eb3a694..753207200 100644 --- a/.github/workflows/create_pr_preview.yml +++ b/.github/workflows/create_pr_preview.yml @@ -9,6 +9,7 @@ on: permissions: contents: write + pages: write id-token: write concurrency: diff --git a/.github/workflows/deploy_development_website.yml b/.github/workflows/deploy_development_website.yml index 4561941cc..7ffca8ae0 100644 --- a/.github/workflows/deploy_development_website.yml +++ b/.github/workflows/deploy_development_website.yml @@ -9,6 +9,7 @@ on: permissions: contents: write + pages: write id-token: write concurrency: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e49c5542c..683bcd800 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,7 @@ on: permissions: contents: write + pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. diff --git a/.github/workflows/remove_pr_preview.yml b/.github/workflows/remove_pr_preview.yml index 331a03f12..ba23deef3 100644 --- a/.github/workflows/remove_pr_preview.yml +++ b/.github/workflows/remove_pr_preview.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + pages: write id-token: write concurrency: