/ proof-of-concept / stan-web-ide
Sign in
proof-of-concept / stan-web-ide
Add the mochi shadow of the deploy workflow, cloning minwebide from github.com
Jeremy Magland <jmagland@flatironinstitute.org> committed commit 90f28a47d83b parent e20b703 Browse files
1 changed file+84−0
.mochi/workflows/deploy.ymladded+84−0View file
@@ -0,0 +1,84 @@
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 stan-web-ide
34+ uses: actions/checkout@v4
35+ with:
36+ path: stan-web-ide
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 stan-web-ide
59+ working-directory: stan-web-ide
60+ env:
61+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
62+ run: npm ci
63+
64+ - name: Build
65+ working-directory: stan-web-ide
66+ env:
67+ DEPLOY_BASE: ${{ steps.pages.outputs.base_path }}
68+ run: npm run build
69+
70+ - name: Upload artifact
71+ uses: actions/upload-pages-artifact@v3
72+ with:
73+ path: stan-web-ide/dist
74+
75+ deploy:
76+ needs: build
77+ runs-on: ubuntu-latest
78+ environment:
79+ name: github-pages
80+ url: ${{ steps.deployment.outputs.page_url }}
81+ steps:
82+ - name: Deploy to Pages
83+ id: deployment
84+ uses: actions/deploy-pages@v4
↑↓ move↵openescclose