13367a8Rename .cofferdam to .mochiJeremy Magland 3# The mochi version of .github/workflows/deploy.yml, which it shadows.
16dc920Clone numbl from github.com in a cofferdam-side workflowowner 4# Two differences, both forced by the vault: `actions/checkout` with a
5# `repository:` names a repository in this vault, so numbl is cloned from
6# github.com with git; and there is no cache service, so `cache: npm` is
7# dropped rather than warned about on every run.
9on:
10 push:
11 branches: [main]
12 schedule:
13 - cron: "0 6 * * *"
14 workflow_dispatch:
16permissions:
17 contents: read
18 pages: write
19 id-token: write
21concurrency:
22 group: pages
23 cancel-in-progress: false
25jobs:
26 build:
27 runs-on: ubuntu-latest
28 steps:
ddbaf44Use a collection-agnostic checkout path in deploy workflowsJeremy Magland 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)
16dc920Clone numbl from github.com in a cofferdam-side workflowowner 33 # so the app's `"numbl": "file:../../numbl"` resolves to <workspace>/numbl.
ddbaf44Use a collection-agnostic checkout path in deploy workflowsJeremy Magland 34 # Only the nesting depth matters here; the `repos/` name is arbitrary.
36 uses: actions/checkout@v4
37 with:
ddbaf44Use a collection-agnostic checkout path in deploy workflowsJeremy Magland 38 path: repos/numbl-figure-viewer
40 - name: Clone numbl (main)
41 run: git clone --depth 1 --branch main https://github.com/flatironinstitute/numbl.git numbl
43 - uses: actions/setup-node@v4
44 with:
45 node-version: 22
47 # Build the numbl/graphics browser bundle the app imports. (HUSKY=0 skips
48 # the git-hook setup in numbl's prepare script; numbl's own install script
49 # is a no-op, so no native addon is built.)
50 - name: Build numbl/graphics
51 working-directory: numbl
52 env:
53 HUSKY: 0
54 run: |
55 npm ci
56 npm run build:graphics
58 - name: Install app dependencies
ddbaf44Use a collection-agnostic checkout path in deploy workflowsJeremy Magland 59 working-directory: repos/numbl-figure-viewer
62 - name: Build app
ddbaf44Use a collection-agnostic checkout path in deploy workflowsJeremy Magland 63 working-directory: repos/numbl-figure-viewer
66 - uses: actions/configure-pages@v5
68 - uses: actions/upload-pages-artifact@v3
69 with:
ddbaf44Use a collection-agnostic checkout path in deploy workflowsJeremy Magland 70 path: repos/numbl-figure-viewer/dist
72 deploy:
73 needs: build
74 runs-on: ubuntu-latest
75 environment:
76 name: github-pages
77 url: ${{ steps.deployment.outputs.page_url }}
78 steps:
79 - id: deployment
80 uses: actions/deploy-pages@v4