name: Deploy to Pages # Builds the app and publishes it as this repository's site. # # midiboot imports the simulated instruments as source from the sibling # repos (simulated_instruments//instrument), so the job recreates # the vault layout inside the workspace: this repository is checked out # at proof-of-concept/midiboot and each instrument repo at # simulated_instruments/, which is where the relative imports and # vite's fs.allow expect them. The instrument checkouts pin ref: main # (without it, checkout would ask the sibling for this repository's # commit sha), so the deployed site tracks the siblings' main as of the # time this workflow runs; a push to a sibling does not retrigger it. # # Three notes on the vault: # - there is no cache service, so setup-node runs without `cache: npm`; # - a mochi site is served at ///site/ or at the root of an # origin of its own. The Vite build uses a relative base (`base: './'`), so # it works at either without being told the deploy path, and configure-pages # is therefore only here for parity with the deploy step. # - the runner is one small machine shared by every repository in the vault, # so this workflow does no more than install, build, and publish. The tests # are deliberately not here: run `npm test` locally, and the per-model # checks in each simulated_instruments//instrument, before pushing. on: push: branches: [main] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: path: proof-of-concept/midiboot - uses: actions/checkout@v4 with: repository: simulated_instruments/bass ref: main path: simulated_instruments/bass - uses: actions/checkout@v4 with: repository: simulated_instruments/woodblock ref: main path: simulated_instruments/woodblock - uses: actions/checkout@v4 with: repository: simulated_instruments/recorder ref: main path: simulated_instruments/recorder - uses: actions/checkout@v4 with: repository: simulated_instruments/cymbal2 ref: main path: simulated_instruments/cymbal2 - uses: actions/checkout@v4 with: repository: simulated_instruments/triangle ref: main path: simulated_instruments/triangle - uses: actions/checkout@v4 with: repository: simulated_instruments/maraca ref: main path: simulated_instruments/maraca - uses: actions/setup-node@v4 with: node-version: 22 - name: Install (instruments) run: | for r in bass woodblock recorder cymbal2 triangle maraca; do npm ci --prefix "simulated_instruments/$r/instrument" done - name: Install working-directory: proof-of-concept/midiboot run: npm ci - name: Build working-directory: proof-of-concept/midiboot run: npm run build - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: proof-of-concept/midiboot/dist deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to Pages id: deployment uses: actions/deploy-pages@v4