-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (61 loc) · 2.14 KB
/
pages.yml
File metadata and controls
66 lines (61 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: pages
on:
push:
branches: [main]
paths:
- "site/**"
- "packages/core/**"
- "scripts/build-playground-bundle.mjs"
- ".github/workflows/pages.yml"
workflow_dispatch:
# Top-level permissions are read-only by default for safety. Each job below
# declares the specific writes it needs — this is robust to org policies
# that restrict default token scopes.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 9.12.0 }
- uses: actions/setup-node@v4
with: { node-version: "22", cache: "pnpm" }
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @glyph/core run build
- run: node scripts/build-playground-bundle.mjs
- name: Verify bundle + schema are fresh (match what build:playground produces)
run: |
# The committed site/play/glyph-bundle.js + site/play/spec.schema.json
# should both be byte-identical to what `pnpm run build:playground`
# produces. If either drifts, someone changed @glyph/core (compiler
# output or Zod schemas) and forgot to regenerate the deploy artifacts.
STALE=$(git status --porcelain site/play/glyph-bundle.js site/play/spec.schema.json)
if [ -n "$STALE" ]; then
echo "::error::Generated playground artifacts are stale. Run 'pnpm run build:playground' and commit the result."
echo "$STALE"
git diff --stat site/play/glyph-bundle.js site/play/spec.schema.json
exit 1
fi
test -s site/play/glyph-bundle.js
test -s site/play/spec.schema.json
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4