/ simulated_instruments / woodblock
Sign in
simulated_instruments / woodblock
Add site deploy workflow
Builds webapp/ and publishes it as the repository site. The model validation runs as a gate before the build. No npm cache: the vault has no cache service.
Jeremy Magland <jmagland@flatironinstitute.org> committed commit e1645a86c95e parent 0bec915 Browse files
1 changed file+67−0
.github/workflows/deploy.ymladded+67−0View file
@@ -0,0 +1,67 @@
1+name: Deploy to Pages
2+
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.
11+
12+on:
13+ push:
14+ branches: [main]
15+ workflow_dispatch:
16+
17+permissions:
18+ contents: read
19+ pages: write
20+ id-token: write
21+
22+concurrency:
23+ group: pages
24+ cancel-in-progress: false
25+
26+jobs:
27+ build:
28+ runs-on: ubuntu-latest
29+ steps:
30+ - uses: actions/checkout@v4
31+
32+ - uses: actions/setup-node@v4
33+ with:
34+ node-version: 22
35+
36+ - name: Install
37+ working-directory: webapp
38+ run: npm ci
39+
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
45+
46+ - name: Build
47+ working-directory: webapp
48+ run: npm run build
49+
50+ - name: Setup Pages
51+ uses: actions/configure-pages@v5
52+
53+ - name: Upload artifact
54+ uses: actions/upload-pages-artifact@v3
55+ with:
56+ path: webapp/dist
57+
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
↑↓ move↵openescclose