1name: Deploy to Pages
3# Builds the app and publishes it as this repository's site.
4#
5# midiboot imports the simulated instruments as source from the sibling
6# repos (simulated_instruments/<repo>/instrument), so the job recreates
7# the vault layout inside the workspace: this repository is checked out
8# at proof-of-concept/midiboot and each instrument repo at
9# simulated_instruments/<repo>, which is where the relative imports and
10# vite's fs.allow expect them. The instrument checkouts pin ref: main
11# (without it, checkout would ask the sibling for this repository's
12# commit sha), so the deployed site tracks the siblings' main as of the
13# time this workflow runs; a push to a sibling does not retrigger it.
14#
15# Three notes on the vault:
16# - there is no cache service, so setup-node runs without `cache: npm`;
17# - a mochi site is served at /<collection>/<repo>/site/ or at the root of an
18# origin of its own. The Vite build uses a relative base (`base: './'`), so
19# it works at either without being told the deploy path, and configure-pages
20# is therefore only here for parity with the deploy step.
21# - the runner is one small machine shared by every repository in the vault,
22# so this workflow does no more than install, build, and publish. The tests
23# are deliberately not here: run `npm test` locally, and the per-model
24# checks in each simulated_instruments/<repo>/instrument, before pushing.
26on:
27 push:
28 branches: [main]
29 workflow_dispatch:
31permissions:
32 contents: read
33 pages: write
34 id-token: write
36concurrency:
37 group: pages
38 cancel-in-progress: false
40jobs:
41 build:
42 runs-on: ubuntu-latest
43 steps:
44 - uses: actions/checkout@v4
45 with:
46 path: proof-of-concept/midiboot
48 - uses: actions/checkout@v4
49 with:
50 repository: simulated_instruments/bass
51 ref: main
52 path: simulated_instruments/bass
54 - uses: actions/checkout@v4
55 with:
56 repository: simulated_instruments/woodblock
57 ref: main
58 path: simulated_instruments/woodblock
60 - uses: actions/checkout@v4
61 with:
62 repository: simulated_instruments/recorder
63 ref: main
64 path: simulated_instruments/recorder
66 - uses: actions/checkout@v4
67 with:
68 repository: simulated_instruments/cymbal2
69 ref: main
70 path: simulated_instruments/cymbal2
72 - uses: actions/checkout@v4
73 with:
74 repository: simulated_instruments/triangle
75 ref: main
76 path: simulated_instruments/triangle
78 - uses: actions/checkout@v4
79 with:
80 repository: simulated_instruments/maraca
81 ref: main
82 path: simulated_instruments/maraca
84 - uses: actions/setup-node@v4
85 with:
86 node-version: 22
88 - name: Install (instruments)
89 run: |
90 for r in bass woodblock recorder cymbal2 triangle maraca; do
91 npm ci --prefix "simulated_instruments/$r/instrument"
92 done
94 - name: Install
95 working-directory: proof-of-concept/midiboot
96 run: npm ci
98 - name: Build
99 working-directory: proof-of-concept/midiboot
100 run: npm run build
102 - name: Setup Pages
103 uses: actions/configure-pages@v5
105 - name: Upload artifact
106 uses: actions/upload-pages-artifact@v3
107 with:
108 path: proof-of-concept/midiboot/dist
110 deploy:
111 needs: build
112 runs-on: ubuntu-latest
113 environment:
114 name: github-pages
115 url: ${{ steps.deployment.outputs.page_url }}
116 steps:
117 - name: Deploy to Pages
118 id: deployment
119 uses: actions/deploy-pages@v4