Skip to content

Deploy to GitHub Pages #57

Deploy to GitHub Pages

Deploy to GitHub Pages #57

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main]
merge_group:
branches: [main]
# Nightly rebuild so live-fetched figures (governance params via
# fetch-governance-params.mjs, network stats via fetch-network-stats.mjs)
# stay fresh even without a content change. Runs prefetch → build → deploy.
schedule:
- cron: '0 6 * * *' # 06:00 UTC daily
# Allow a maintainer to force a data refresh on demand.
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build site
run: npm run build
- name: Build Pagefind search index
run: npx pagefind --site dist
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4