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/recorder_validate.m through numbl: the closed-form
41 # open-open cylinder, the modal-fit identity, emergent register
42 # selection and overblowing, reproducibility of the seeded turbulence,
43 # and the pinned end-to-end diagnostics. Fails the build on any
44 # mismatch.
45 - name: Validate the model
46 working-directory: webapp
47 run: npm run selftest
49 - name: Build
50 working-directory: webapp
51 run: npm run build
53 - name: Setup Pages
54 uses: actions/configure-pages@v5
56 - name: Upload artifact
57 uses: actions/upload-pages-artifact@v3
58 with:
59 path: webapp/dist
61 deploy:
62 needs: build
63 runs-on: ubuntu-latest
64 environment:
65 name: github-pages
66 url: ${{ steps.deployment.outputs.page_url }}
67 steps:
68 - name: Deploy to Pages
69 id: deployment
70 uses: actions/deploy-pages@v4