Skip to content
Merged
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
56 changes: 38 additions & 18 deletions .github/workflows/build_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,50 @@ on:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
# 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:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: npm
- name: Configure Git
run: |
git config user.name "Publisher"
git config user.email "publisher@users.noreply.github.com"
- name: Build website
run: npm install

- name: Install dependencies
run: npm ci

- name: Build website
run: npm run build
- name: Switch to branch 'gh-pages'
run: |
git branch -f gh-pages HEAD
git checkout gh-pages
- run: |
cp CNAME build/CNAME
git add -f build/
git commit -m "Publish"
git push -f origin `git subtree split -P build`:refs/heads/gh-pages

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4