/ simulated_instruments / triangle
Sign in
simulated_instruments / triangle
triangle / .github / workflows / deploy.yml
71 lines · 1.9 KBBlameHistoryRaw
1name: Deploy to Pages
3# Builds webapp/ and publishes it as this repository's site.
4#
5# Three 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.
11# - the runner is one small machine shared by every repository in the vault,
12# so this workflow does no more than install, build, and publish. The model
13# validation is deliberately not here: `npm run selftest` executes the
14# MATLAB validation script through numbl, which takes minutes on a
15# development machine and far longer on the runner. Run it locally before
16# pushing.
18on:
19 push:
20 branches: [main]
21 workflow_dispatch:
23permissions:
24 contents: read
25 pages: write
26 id-token: write
28concurrency:
29 group: pages
30 cancel-in-progress: false
32jobs:
33 build:
34 runs-on: ubuntu-latest
35 steps:
36 - uses: actions/checkout@v4
38 - uses: actions/setup-node@v4
39 with:
40 node-version: 22
42 - name: Install (instrument)
43 working-directory: instrument
44 run: npm ci
46 - name: Install
47 working-directory: webapp
48 run: npm ci
50 - name: Build
51 working-directory: webapp
52 run: npm run build
54 - name: Setup Pages
55 uses: actions/configure-pages@v5
57 - name: Upload artifact
58 uses: actions/upload-pages-artifact@v3
59 with:
60 path: webapp/dist
62 deploy:
63 needs: build
64 runs-on: ubuntu-latest
65 environment:
66 name: github-pages
67 url: ${{ steps.deployment.outputs.page_url }}
68 steps:
69 - name: Deploy to Pages
70 id: deployment
71 uses: actions/deploy-pages@v4
↑↓ move↵openescclose