name: Deploy the lab # configure-pages runs before the build rather than after it, because the build # needs the base path it reports: a mochi site is served at the root of its own # origin when the repository has a site label, and under ///site/ # when it does not, and never at //. 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: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: 22 - name: Setup Pages id: pages uses: actions/configure-pages@v5 - name: Install run: npm ci - name: Typecheck run: npm run typecheck # Runs the .m library under numbl in Node against the reference diagnostics # of the two Python simulators: mode frequencies, contact numbers and the # first 50 ms of sound. A regression here should not deploy. - name: Test run: npm test - name: Build the lab env: DEPLOY_BASE: ${{ steps.pages.outputs.base_path }} run: npm run build -w apps/lab - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: apps/lab/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