Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@ concurrency:
cancel-in-progress: true

jobs:
sync:
name: Sync Main to GH-Pages
uses: ./.github/workflows/sync-gh-pages.yml
permissions:
contents: write

deploy:
name: Deploy Site To GitHub Pages
needs: sync
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.sync.outputs.synced_sha }}
- uses: actions/setup-node@v4
with:
node-version: 20
Expand All @@ -38,7 +47,7 @@ jobs:
run: |
npm test
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: ./website/build
- name: Deploy to GitHub Pages
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/sync-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Sync Main to GH-Pages

# Syncs the main branch to gh-pages so that the release workflow
# can be triggered from gh-pages (required by environment protection rules).
on:
workflow_dispatch:
workflow_call:

permissions:
contents: write

jobs:
sync:
name: Sync Main to GH-Pages Branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Push main to gh-pages
run: git push origin main:gh-pages --force-with-lease
Loading