1name: Deploy to Pages
3# Builds webapp/ and publishes it as this repository's site.
4#
5# Two notes on the vault:
6# - there is no cache service, so setup-node runs without `cache: npm`;
7# - a mochi site is served at /<collection>/<repo>/site/ or at the root of an
8# origin of its own. The Vite build uses a relative base (`base: './'`), so
9# it works at either without being told the deploy path, and configure-pages
10# is therefore only here for parity with the deploy step.
12on:
13 push:
14 branches: [main]
15 workflow_dispatch:
17permissions:
18 contents: read
19 pages: write
20 id-token: write
22concurrency:
23 group: pages
24 cancel-in-progress: false
26jobs:
27 build:
28 runs-on: ubuntu-latest
29 steps:
30 - uses: actions/checkout@v4
32 - uses: actions/setup-node@v4
33 with:
34 node-version: 22
36 - name: Install
37 working-directory: webapp
38 run: npm ci
40 # Runs matlab/woodblock_validate.m through numbl and fails on any
41 # departure from the woodblock.py reference diagnostics.
42 - name: Validate the model against the reference
43 working-directory: webapp
44 run: npm run selftest
46 - name: Build
47 working-directory: webapp
48 run: npm run build
50 - name: Setup Pages
51 uses: actions/configure-pages@v5
53 - name: Upload artifact
54 uses: actions/upload-pages-artifact@v3
55 with:
56 path: webapp/dist
58 deploy:
59 needs: build
60 runs-on: ubuntu-latest
61 environment:
62 name: github-pages
63 url: ${{ steps.deployment.outputs.page_url }}
64 steps:
65 - name: Deploy to Pages
66 id: deployment
67 uses: actions/deploy-pages@v4