Repository navigation
145 lines (136 loc) · 6.16 KB
/
Copy pathdocs.yml
File metadata and controls
145 lines (136 loc) · 6.16 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "mkdocs.yml"
- "packages/agent-ui/ts/**"
- "packages/agent-shell/web/**"
- "spec/blocks/**"
- ".github/workflows/docs.yml"
- "wrangler.jsonc"
pull_request:
paths:
- "docs/**"
- "mkdocs.yml"
- "packages/agent-ui/ts/**"
- "packages/agent-shell/web/**"
- "spec/blocks/**"
- ".github/workflows/docs.yml"
- "wrangler.jsonc"
permissions:
contents: read
concurrency:
# Per PR / branch. A repo-wide `pages` group made every docs PR cancel
# every other in-flight docs build (this PR's check went cancelled).
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# --- mkdocs site (Python) -------------------------------------------------
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: docs/requirements.txt
- run: pip install -r docs/requirements.txt
- run: mkdocs build --strict --site-dir _site
# --- Storybook (Node) ----------------------------------------------------
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 26
cache: pnpm
- run: pnpm install --frozen-lockfile
# The Storybook build and the agent-shell demo build both resolve
# workspace packages (@steerable/agent-ui, @steerable/agent-protocol,
# @steerable/pack-sdk) through their built `dist/` entry points, so the
# TS workspace must be built first — same install → build order as
# ci.yml.
- run: pnpm build
# Storybook is generated *into* the mkdocs site so a single Pages
# deployment serves both `/` (docs) and `/storybook/` (UI).
- name: Build Storybook
env:
STORYBOOK_DISABLE_TELEMETRY: "1"
CI: "1"
run: pnpm --filter @steerable/agent-ui storybook:build
- name: Embed Storybook into mkdocs site
run: |
mkdir -p _site/storybook
cp -R packages/agent-ui/ts/storybook-static/. _site/storybook/
# --- Agent-shell demo (Vite) --------------------------------------------
# Build the Tier 5 host shell as a static, mock-backed demo and embed it
# at /demo/. The app-demo entry installs the browser Electron mock
# (fixture data + simulated streaming) before bootstrap, so visitors get
# the real shell UI without a backend. The demo config uses `base: './'`
# so the same dist works under any deploy prefix.
- name: Build agent-shell demo
run: pnpm --filter @steerable/agent-shell-web app:build:demo
- name: Embed agent-shell demo into mkdocs site
run: |
mkdir -p _site/demo
cp -R packages/agent-shell/web/app-demo/dist/. _site/demo/
# D4 (docs render smoke test): mkdocs build --strict already passes when
# markdown is *parseable*, but that is not enough. Pinning
# `pymdown-extensions==10.12` produced fully-built HTML where every
# fenced code block was rendered as a literal `<p>` containing the
# backticks (commit 91fb79d). The probes below grep the rendered HTML
# for known signal patterns so the same class of "build green, output
# broken" regression fails fast in CI.
#
# Each probe is its own `run:` step so:
# 1. The failing step name in the GitHub UI tells you exactly which
# invariant broke.
# 2. Each script body is small enough that a stray bash quote / paren
# in an error message can't take down the whole gate (which bit us
# once with a one-shot multi-probe script).
- name: D4 probe 1 — no literal triple-backtick leaked into a <p>
run: |
if grep -RE '<p>```' _site --include='*.html' >/tmp/probe1.txt ; then
echo "::error::Fenced-code parsing is broken: triple-backtick fence leaked into a paragraph tag."
cat /tmp/probe1.txt | head -10
exit 1
fi
- name: D4 probe 2 — home page Tier diagram is a Mermaid graph BT block
run: |
if ! grep -q '<pre class="mermaid"><code>graph BT' _site/index.html ; then
echo "::error::Home page Tier diagram is no longer a Mermaid pre.mermaid block."
exit 1
fi
- name: D4 probe 3 — sidecar boot sequence is a Mermaid sequenceDiagram
run: |
if ! grep -q '<pre class="mermaid"><code>sequenceDiagram' _site/spec/sidecar/index.html ; then
echo "::error::Sidecar boot sequence is no longer a Mermaid sequenceDiagram block."
exit 1
fi
- name: D4 probe 4 — sidecar page has at least 5 highlighted code blocks
run: |
n=$(grep -c '<div class="highlight">' _site/spec/sidecar/index.html || true)
: "${n:=0}"
echo "found $n highlight blocks, minimum required is 5"
if [ "$n" -lt 5 ]; then
echo "::error::Sidecar page has fewer than 5 highlight blocks - JSON fences are not rendering."
exit 1
fi
- name: D4 probe 5 — UI index 'Working on it locally' bash block is fenced
run: |
if ! grep -q '<h2 id="working-on-it-locally">' _site/ui/index.html ; then
echo "::warning::ui/index.html is missing the heading; skipping fence check."
exit 0
fi
if ! grep -A1 '<h2 id="working-on-it-locally">' _site/ui/index.html | grep -q '<div class="highlight">' ; then
echo "::error::UI 'Working on it locally' bash block is not rendered as a fenced highlight div."
exit 1
fi
- name: Deploy to Cloudflare Workers
if: github.ref == 'refs/heads/main' && github.repository == 'pathlyapp/steerable'
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# 4.139.0 published with a missing npm tarball (404). 4.138.0 is the last deploy that succeeded.
run: npx --yes wrangler@4.138.0 deploy