From f505d2ad5d40cbcb19b6d16e553d18cc114af599 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 16:11:37 -0400 Subject: [PATCH 01/10] Creates initial GH Actions config --- .github/workflows/deploy.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ab43036 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [master] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: 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. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file From 39cb12323559055a7d14c24c944e13fa060552d1 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 16:19:12 -0400 Subject: [PATCH 02/10] Tries using Actions for preview pages --- .github/workflows/deploy.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ab43036..60dca98 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,9 @@ name: Deploy static content to Pages on: # Runs on pushes targeting the default branch push: - branches: [master] + branches: [ master ] + pull_request: + branches: [ master ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -22,8 +24,27 @@ concurrency: cancel-in-progress: false jobs: - # Single deploy job since we're just deploying - deploy: + deploy-preview: + if: github.event_name == 'pull_request' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }}/pr_preview_${{ github.event.number }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + deploy-release: + if: github.event_name == 'push' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From 33c97fd49574474e927bad81c5d4aaccccdf62ea Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:02:54 -0400 Subject: [PATCH 03/10] Fixes PR URL --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 60dca98..9a9c5d6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: if: github.event_name == 'pull_request' environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }}/pr_preview_${{ github.event.number }} + url: ${{ steps.deployment.outputs.page_url }}pr_preview_${{ github.event.number }} runs-on: ubuntu-latest steps: - name: Checkout From 195616f49d52b542503eaa9092170e21c11689b2 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:22:55 -0400 Subject: [PATCH 04/10] Tries another approach to push previews --- .github/workflows/deploy.yml | 64 ++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9a9c5d6..4eedb29 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,9 +7,11 @@ on: branches: [ master ] pull_request: branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + types: + - opened + - reopened + - synchronize + - closed # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -26,23 +28,31 @@ concurrency: jobs: deploy-preview: if: github.event_name == 'pull_request' - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }}pr_preview_${{ github.event.number }} + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }}pr_preview_${{ github.event.number }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + - name: Deploy PR Preview + uses: rossjrw/pr-preview-action@v1 with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + token: ${{ secrets.GITHUB_TOKEN }} + preview-branch: main + source-dir: . + umbrella-dir: pr-preview-${{ github.event.number }} + action: auto + # - name: Setup Pages + # uses: actions/configure-pages@v5 + # - name: Upload artifact + # uses: actions/upload-pages-artifact@v3 + # with: + # # Upload entire repository + # path: '.' + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@v4 deploy-release: if: github.event_name == 'push' environment: @@ -52,13 +62,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + - name: Deploy website + uses: JamesIves/github-pages-deploy-action@v4 with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + folder: . + clean-exclude: pr-preview-*/ + force: false + # - name: Setup Pages + # uses: actions/configure-pages@v5 + # - name: Upload artifact + # uses: actions/upload-pages-artifact@v3 + # with: + # # Upload entire repository + # path: '.' + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@v4 \ No newline at end of file From c291c59a51f6fb18d06da80c77a691c57a46b578 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:26:47 -0400 Subject: [PATCH 05/10] Changes token --- .github/workflows/deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4eedb29..ad68d11 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,6 @@ jobs: - name: Deploy PR Preview uses: rossjrw/pr-preview-action@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} preview-branch: main source-dir: . umbrella-dir: pr-preview-${{ github.event.number }} From d836beb9762d94bea5ba7679d766592abd691426 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:33:20 -0400 Subject: [PATCH 06/10] Fixes preview branch --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ad68d11..9c43c8d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,7 @@ jobs: - name: Deploy PR Preview uses: rossjrw/pr-preview-action@v1 with: - preview-branch: main + preview-branch: master source-dir: . umbrella-dir: pr-preview-${{ github.event.number }} action: auto From 45aa495e74278e64dc3dc2c01a3bd27fb5f0b661 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:36:23 -0400 Subject: [PATCH 07/10] Removes branch config for PR --- .github/workflows/deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9c43c8d..d49b050 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,7 +6,6 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] types: - opened - reopened From e80202716a6ea9eeb76bbd59f6bd69e4a432414b Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:40:26 -0400 Subject: [PATCH 08/10] Fixes umbrella dir --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d49b050..eea0951 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,7 +39,7 @@ jobs: with: preview-branch: master source-dir: . - umbrella-dir: pr-preview-${{ github.event.number }} + umbrella-dir: pr-preview action: auto # - name: Setup Pages # uses: actions/configure-pages@v5 @@ -64,7 +64,7 @@ jobs: uses: JamesIves/github-pages-deploy-action@v4 with: folder: . - clean-exclude: pr-preview-*/ + clean-exclude: pr-preview/ force: false # - name: Setup Pages # uses: actions/configure-pages@v5 From e7f8fc4a6c88bf2701c8d14fd05923e05a5c6002 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:43:26 -0400 Subject: [PATCH 09/10] Removes action --- .github/workflows/deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index eea0951..0e28eb0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,7 +40,6 @@ jobs: preview-branch: master source-dir: . umbrella-dir: pr-preview - action: auto # - name: Setup Pages # uses: actions/configure-pages@v5 # - name: Upload artifact From 07def9f03768a8a75bb0f1abac3c8aa4d5196d2f Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 30 Oct 2024 17:46:05 -0400 Subject: [PATCH 10/10] Fixes content token permissions --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0e28eb0..80216d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ on: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: read + contents: write pages: write id-token: write