name: Deploy to Pages # The mochi version of .github/workflows/deploy.yml, which it shadows. # Three differences, all forced by the vault: # # - `actions/checkout` with a `repository:` names a repository in this vault, # so minwebide is cloned from github.com with git; # - there is no cache service and no hashFiles(), so the VS Code source is # fetched on every run rather than cached; # - a mochi site is served where the vault says, at ///site/ # or at the root of an origin of its own, never at //, so the base # path comes from configure-pages (which therefore has to run before the # build) rather than being written out by hand. 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 minwebide-demo uses: actions/checkout@v4 with: path: minwebide-demo # minwebide is consumed as a sibling checkout (file:../minwebide) - name: Clone minwebide run: git clone --depth 1 https://github.com/magland/minwebide.git minwebide - uses: actions/setup-node@v4 with: node-version: 22 # Before the build rather than after it: the build needs the base path # this reports, and it is not the one GitHub would serve the site at. - name: Setup Pages id: pages uses: actions/configure-pages@v5 - name: Install minwebide (fetches VS Code source on postinstall) working-directory: minwebide env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' run: npm ci - name: Install minwebide-demo working-directory: minwebide-demo run: npm ci - name: Build working-directory: minwebide-demo env: DEPLOY_BASE: ${{ steps.pages.outputs.base_path }} run: npm run build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: minwebide-demo/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