1name: Deploy to GitHub Pages
3# Builds this app against the development version of numbl (its `main` branch),
4# which is checked out as a sibling directory so the `numbl` file: dependency
5# (../../numbl) resolves exactly as it does in local development. Runs on every
6# push, on a daily schedule (to pick up numbl `main` changes), and on demand.
8on:
9 push:
10 branches: [main]
11 schedule:
12 - cron: "0 6 * * *"
13 workflow_dispatch:
15permissions:
16 contents: read
17 pages: write
18 id-token: write
20# Allow one concurrent deployment; don't cancel an in-progress production deploy.
21concurrency:
22 group: pages
23 cancel-in-progress: false
25jobs:
26 build:
27 runs-on: ubuntu-latest
28 steps:
29 # Mirror the local dev layout, where the app sits one level below the
30 # vault root alongside a checkout of numbl:
31 # <workspace>/repos/numbl-figure-viewer (this app)
32 # <workspace>/numbl (numbl main)
33 # so the app's `"numbl": "file:../../numbl"` resolves to <workspace>/numbl.
34 # Only the nesting depth matters here; the `repos/` name is arbitrary.
35 - name: Checkout app
36 uses: actions/checkout@v4
37 with:
38 path: repos/numbl-figure-viewer
40 - name: Checkout numbl (main)
41 uses: actions/checkout@v4
42 with:
43 repository: flatironinstitute/numbl
44 ref: main
45 path: numbl
47 - uses: actions/setup-node@v4
48 with:
49 node-version: 22
50 cache: npm
51 cache-dependency-path: |
52 numbl/package-lock.json
53 repos/numbl-figure-viewer/package-lock.json
55 # Build the numbl/graphics browser bundle the app imports. (HUSKY=0 skips
56 # the git-hook setup in numbl's prepare script; numbl's own install script
57 # is a no-op, so no native addon is built.)
58 - name: Build numbl/graphics
59 working-directory: numbl
60 env:
61 HUSKY: 0
62 run: |
63 npm ci
64 npm run build:graphics
66 - name: Install app dependencies
67 working-directory: repos/numbl-figure-viewer
68 run: npm install
70 - name: Build app
71 working-directory: repos/numbl-figure-viewer
72 run: npm run build:pages
74 - uses: actions/configure-pages@v5
76 - uses: actions/upload-pages-artifact@v3
77 with:
78 path: repos/numbl-figure-viewer/dist
80 deploy:
81 needs: build
82 runs-on: ubuntu-latest
83 environment:
84 name: github-pages
85 url: ${{ steps.deployment.outputs.page_url }}
86 steps:
87 - id: deployment
88 uses: actions/deploy-pages@v4