216cbe1Add the mochi shadow of the deploy workflow, cloning minwebide from github.comJeremy Magland 1name: Deploy to Pages
3# The mochi version of .github/workflows/deploy.yml, which it shadows.
4# Three differences, all forced by the vault:
5#
6# - `actions/checkout` with a `repository:` names a repository in this vault,
7# so minwebide is cloned from github.com with git;
8# - there is no cache service and no hashFiles(), so the VS Code source is
9# fetched on every run rather than cached;
10# - a mochi site is served where the vault says, at /<collection>/<repo>/site/
11# or at the root of an origin of its own, never at /<repo>/, so the base
12# path comes from configure-pages (which therefore has to run before the
13# build) rather than being written out by hand.
15on:
16 push:
17 branches: [main]
18 workflow_dispatch:
20permissions:
21 contents: read
22 pages: write
23 id-token: write
25concurrency:
26 group: pages
27 cancel-in-progress: false
29jobs:
30 build:
31 runs-on: ubuntu-latest
32 steps:
33 - name: Checkout minwebide-demo
34 uses: actions/checkout@v4
35 with:
36 path: minwebide-demo
38 # minwebide is consumed as a sibling checkout (file:../minwebide)
39 - name: Clone minwebide
40 run: git clone --depth 1 https://github.com/magland/minwebide.git minwebide
42 - uses: actions/setup-node@v4
43 with:
44 node-version: 22
46 # Before the build rather than after it: the build needs the base path
47 # this reports, and it is not the one GitHub would serve the site at.
48 - name: Setup Pages
49 id: pages
50 uses: actions/configure-pages@v5
52 - name: Install minwebide (fetches VS Code source on postinstall)
53 working-directory: minwebide
54 env:
55 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
56 run: npm ci
58 - name: Install minwebide-demo
59 working-directory: minwebide-demo
60 run: npm ci
62 - name: Build
63 working-directory: minwebide-demo
64 env:
65 DEPLOY_BASE: ${{ steps.pages.outputs.base_path }}
66 run: npm run build
68 - name: Upload artifact
69 uses: actions/upload-pages-artifact@v3
70 with:
71 path: minwebide-demo/dist
73 deploy:
74 needs: build
75 runs-on: ubuntu-latest
76 environment:
77 name: github-pages
78 url: ${{ steps.deployment.outputs.page_url }}
79 steps:
80 - name: Deploy to Pages
81 id: deployment
82 uses: actions/deploy-pages@v4