Repository navigation
112 lines (93 loc) · 3.57 KB
/
Copy pathdeploy.yml
File metadata and controls
112 lines (93 loc) · 3.57 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Deploy to GitHub Pages
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-24.04
# Healthy runtime ~9min; bounded so a hang fails fast instead of sitting
# out the 360min platform default. No Puppeteer browser cache by design:
# a stale Chrome-for-Testing caused flakes, so every build downloads it
# fresh (slower green builds, deterministic browser).
timeout-minutes: 25
defaults:
run:
working-directory: ./website
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: npm
cache-dependency-path: ./website/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Run typecheck
run: npm run typecheck
- name: Audit responsive diagrams
run: npm run audit:responsive-diagrams
- name: Audit context regions
run: npm run audit:context-regions
# Website tests run first without the provider SDK; the CLI's static imports
# require scripts/ dependencies even for its credential-free lint command.
- name: Install audiobook CLI dependencies
run: npm ci --prefix ../scripts
- name: Lint audiobook dialogue
run: npm run audio:dialogue:lint
- name: Refresh GitHub star counts
# Unauthenticated (60 req/hr/IP). The fetcher merges per repo and keeps
# the committed snapshot on failure, so a rate-limited deploy still
# ships the last known counts instead of failing the build.
run: node ../scripts/fetch-github-stars.js
- name: Build website
run: npm run build
# Chrome cannot build its sandbox on ubuntu-24.04 (AppArmor restricts
# unprivileged user namespaces for Puppeteer's downloaded Chrome for
# Testing). Ephemeral root-accessible CI VMs are the sanctioned case for
# disabling this knob — see chromium docs apparmor-userns-restrictions.md.
- name: Allow Chrome sandbox (AppArmor userns restriction on ubuntu-24.04)
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Run browser contract tests against the built site
run: npm run test:browser-contracts
# Healthy runtime ~2-4min; the suite hangs if teardown fails, so this
# step must have its own bound tighter than the job's.
timeout-minutes: 15
env:
BROWSER_TEST_BUILD_DIR: ./build
- name: Upload browser failure traces
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: browser-contracts-traces
path: website/browser-contracts-traces
if-no-files-found: ignore
retention-days: 7
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: ./website/build
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5