/ proof-of-concept / steelsim21
Sign in
proof-of-concept / steelsim21
Deploy workflow: build, test, and publish the app and gallery as the repository site
Jeremy Magland <jmagland@flatironinstitute.org> committed commit dc0cfae9570e parent 65b16eb Browse files
4 changed files+53−1
.github/workflows/deploy.ymladded+40−0View file
@@ -0,0 +1,40 @@
1+name: deploy
2+on:
3+ push:
4+ branches: [main]
5+ workflow_dispatch:
6+
7+permissions:
8+ contents: read
9+ pages: write
10+ id-token: write
11+
12+concurrency:
13+ group: pages
14+ cancel-in-progress: true
15+
16+jobs:
17+ build-deploy:
18+ runs-on: ubuntu-latest
19+ environment:
20+ name: github-pages
21+ url: ${{ steps.deployment.outputs.page_url }}
22+ steps:
23+ - uses: actions/checkout@v4
24+ - uses: actions/setup-node@v4
25+ with:
26+ node-version: 24
27+ cache: npm
28+ # --omit=optional skips the Dawn (webgpu) binary, which is only for the
29+ # experimental command-line engine and needs a recent glibc.
30+ - run: npm ci --omit=optional
31+ # Discretization tests run on the CPU (no GPU needed).
32+ - run: npm test
33+ # Type check, Vite build, and a copy of docs/gallery into dist/docs/gallery.
34+ - run: npm run build
35+ - uses: actions/configure-pages@v5
36+ - uses: actions/upload-pages-artifact@v3
37+ with:
38+ path: dist
39+ - id: deployment
40+ uses: actions/deploy-pages@v4
README.mdmodified+2−0View file
@@ -2,6 +2,8 @@
22
33 A browser simulation of the sound of a thin rectangular stainless steel sheet that hangs from a thread, is pushed by hand at the far corner, held until it settles, and released. The sheet rings like a gong, so the simulator solves the geometrically nonlinear (von Karman) plate equations with in-plane inertia retained, stepped explicitly on the GPU through WebGPU. The model and the numerical method are described in [THEORY.md](THEORY.md).
44
5+The app and the gallery are deployed by the `deploy` workflow on every push to `main`: https://steelsim21--proof-of-concept.vault1-sites.magland.org/ (gallery at `/docs/gallery/index.html`).
6+
57 ## Running
68
79 Requires Node 20 or later and a browser with WebGPU (Chrome or Edge 113+; Firefox and Safari with WebGPU enabled).
package.jsonmodified+1−1View file
@@ -6,7 +6,7 @@
66 "description": "Browser-based nonlinear plate (Foppl-von Karman) sound simulation of a hanging stainless steel sheet, using WebGPU.",
77 "scripts": {
88 "dev": "vite",
9- "build": "tsc --noEmit && vite build",
9+ "build": "tsc --noEmit && vite build && node scripts/copy-gallery.mjs",
1010 "preview": "vite preview",
1111 "test": "node --test tests/*.test.ts",
1212 "build:cli": "vite build --config vite.cli.config.ts",
scripts/copy-gallery.mjsadded+10−0View file
@@ -0,0 +1,10 @@
1+// Copies the generated parameter gallery (without the raw signal cache) into the built site.
2+import { cpSync, existsSync, mkdirSync } from "node:fs";
3+
4+const src = "docs/gallery";
5+const dst = "dist/docs/gallery";
6+if (existsSync(src)) {
7+ mkdirSync(dst, { recursive: true });
8+ cpSync(src, dst, { recursive: true, filter: (p) => !p.includes("/raw") });
9+ console.log(`copied ${src} -> ${dst}`);
10+}
↑↓ move↵openescclose