name: deploy on: push: branches: [main] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: true jobs: build-deploy: runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 24 cache: npm # numbl is a `file:../../numbl` dependency: we use its compiler internals # (parser, lowerer, IR, inline pass) and its interpreter, which its # published package `exports` do not expose. Clone it where that relative # path expects it. Pinned to the exact commit this project was built and # tested against, so CI builds exactly what was verified locally rather # than whatever numbl's main happens to be on the day it runs. # # numbl's own dependencies are NOT needed: the slice we import is # self-contained TypeScript, verified by building against a checkout with # no node_modules. One file in it is generated rather than committed, # though — the interpreter's stdlib bundle, which numbl gitignores — so a # bare checkout is missing it and `executeCode.ts` (used to evaluate scene # .m files on the CPU) fails to resolve it. Its generator only reads .m # files off disk, so plain `node` (type-stripping, unflagged since 22.18) # runs it without installing anything. - name: Check out numbl (sibling dependency) env: NUMBL_REF: 3901dbcbfa127240ee57a158184b2aa235478754 run: | git clone --filter=blob:none --no-checkout \ https://github.com/flatironinstitute/numbl.git "$GITHUB_WORKSPACE/../../numbl" git -C "$GITHUB_WORKSPACE/../../numbl" checkout --quiet "$NUMBL_REF" node "$GITHUB_WORKSPACE/../../numbl/scripts/bundle-stdlib.ts" # --ignore-scripts: npm runs a linked package's `prepare` script, and # numbl's is husky, which is not installed here. - run: npm ci --ignore-scripts # The checks compile MATLAB to compute shaders, so they need a GPU; # --skip-without-gpu lets this runner (which has none) say so and move on. - run: npm run test:node -- --skip-without-gpu - run: npm run build # Pages must already be enabled with "GitHub Actions" as the source; the # workflow token cannot create the site itself (`enablement: true` fails # with "Resource not accessible by integration"). - uses: actions/configure-pages@v5 - uses: actions/upload-pages-artifact@v3 with: path: dist - id: deployment uses: actions/deploy-pages@v4