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 take each repo's
11# default branch, so the deployed site tracks the siblings as of the
12# time this workflow runs; a push to a sibling does not retrigger it.
13#
14# Three notes on the vault:
15# - there is no cache service, so setup-node runs without `cache: npm`;
16# - a mochi site is served at /<collection>/<repo>/site/ or at the root of an
17# origin of its own. The Vite build uses a relative base (`base: './'`), so
18# it works at either without being told the deploy path, and configure-pages
19# is therefore only here for parity with the deploy step.
20# - the runner is one small machine shared by every repository in the vault,
21# so this workflow does no more than install, build, and publish. The tests
22# are deliberately not here: run `npm test` locally, and the per-model
23# checks in each simulated_instruments/<repo>/instrument, before pushing.
25on:
26 push:
27 branches: [main]
28 workflow_dispatch:
30permissions:
31 contents: read
32 pages: write
33 id-token: write
35concurrency:
36 group: pages
37 cancel-in-progress: false
39jobs:
40 build:
41 runs-on: ubuntu-latest
42 steps:
43 - uses: actions/checkout@v4
44 with:
45 path: proof-of-concept/midiboot
47 - uses: actions/checkout@v4
48 with:
49 repository: simulated_instruments/bass
50 path: simulated_instruments/bass
52 - uses: actions/checkout@v4
53 with:
54 repository: simulated_instruments/woodblock
55 path: simulated_instruments/woodblock
57 - uses: actions/checkout@v4
58 with:
59 repository: simulated_instruments/recorder
60 path: simulated_instruments/recorder
62 - uses: actions/checkout@v4
63 with:
64 repository: simulated_instruments/cymbal2
65 path: simulated_instruments/cymbal2
67 - uses: actions/checkout@v4
68 with:
69 repository: simulated_instruments/triangle
70 path: simulated_instruments/triangle
72 - uses: actions/checkout@v4
73 with:
74 repository: simulated_instruments/maraca
75 path: simulated_instruments/maraca
77 - uses: actions/setup-node@v4
78 with:
79 node-version: 22
81 - name: Install (instruments)
82 run: |
83 for r in bass woodblock recorder cymbal2 triangle maraca; do
84 npm ci --prefix "simulated_instruments/$r/instrument"
85 done
87 - name: Install
88 working-directory: proof-of-concept/midiboot
89 run: npm ci
91 - name: Build
92 working-directory: proof-of-concept/midiboot
93 run: npm run build
95 - name: Setup Pages
96 uses: actions/configure-pages@v5
98 - name: Upload artifact
99 uses: actions/upload-pages-artifact@v3
100 with:
101 path: proof-of-concept/midiboot/dist
103 deploy:
104 needs: build
105 runs-on: ubuntu-latest
106 environment:
107 name: github-pages
108 url: ${{ steps.deployment.outputs.page_url }}
109 steps:
110 - name: Deploy to Pages
111 id: deployment
112 uses: actions/deploy-pages@v4