/ concept-collection / numbl-figure-viewer
Sign in
concept-collection / numbl-figure-viewer
numbl-figure-viewer / .github / workflows / deploy.yml
86 lines · 2.5 KBBlameHistoryRaw
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 # Lay the two repos out as siblings matching local dev:
30 # <workspace>/concept-collection/numbl-figure-viewer (this app)
31 # <workspace>/numbl (numbl main)
32 # so the app's `"numbl": "file:../../numbl"` resolves to <workspace>/numbl.
33 - name: Checkout app
34 uses: actions/checkout@v4
35 with:
36 path: concept-collection/numbl-figure-viewer
38 - name: Checkout numbl (main)
39 uses: actions/checkout@v4
40 with:
41 repository: flatironinstitute/numbl
42 ref: main
43 path: numbl
45 - uses: actions/setup-node@v4
46 with:
47 node-version: 22
48 cache: npm
49 cache-dependency-path: |
50 numbl/package-lock.json
51 concept-collection/numbl-figure-viewer/package-lock.json
53 # Build the numbl/graphics browser bundle the app imports. (HUSKY=0 skips
54 # the git-hook setup in numbl's prepare script; numbl's own install script
55 # is a no-op, so no native addon is built.)
56 - name: Build numbl/graphics
57 working-directory: numbl
58 env:
59 HUSKY: 0
60 run: |
61 npm ci
62 npm run build:graphics
64 - name: Install app dependencies
65 working-directory: concept-collection/numbl-figure-viewer
66 run: npm install
68 - name: Build app
69 working-directory: concept-collection/numbl-figure-viewer
70 run: npm run build:pages
72 - uses: actions/configure-pages@v5
74 - uses: actions/upload-pages-artifact@v3
75 with:
76 path: concept-collection/numbl-figure-viewer/dist
78 deploy:
79 needs: build
80 runs-on: ubuntu-latest
81 environment:
82 name: github-pages
83 url: ${{ steps.deployment.outputs.page_url }}
84 steps:
85 - id: deployment
86 uses: actions/deploy-pages@v4
moveopenescclose