Add the mochi shadow of the deploy workflow, cloning minwebide from github.com
1 changed file+82−0
.mochi/workflows/deploy.ymladded+82−0View file
@@ -0,0 +1,82 @@
1+name: Deploy to Pages
2+
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.
14+
15+on:
16+ push:
17+ branches: [main]
18+ workflow_dispatch:
19+
20+permissions:
21+ contents: read
22+ pages: write
23+ id-token: write
24+
25+concurrency:
26+ group: pages
27+ cancel-in-progress: false
28+
29+jobs:
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
37+
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
41+
42+ - uses: actions/setup-node@v4
43+ with:
44+ node-version: 22
45+
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
51+
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
57+
58+ - name: Install minwebide-demo
59+ working-directory: minwebide-demo
60+ run: npm ci
61+
62+ - name: Build
63+ working-directory: minwebide-demo
64+ env:
65+ DEPLOY_BASE: ${{ steps.pages.outputs.base_path }}
66+ run: npm run build
67+
68+ - name: Upload artifact
69+ uses: actions/upload-pages-artifact@v3
70+ with:
71+ path: minwebide-demo/dist
72+
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