Repository navigation
79 lines (74 loc) · 2.95 KB
/
Copy pathpages_dashboard.yml
File metadata and controls
79 lines (74 loc) · 2.95 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
name: Pages Dashboard
# Serves the generated `dashboard.html` — the Cortex board's one-tap-copy twin —
# at this repo's GitHub Pages URL (as the site's index page).
#
# Why a twin exists at all: GitHub's markdown rendering strips JavaScript, so
# `dashboard.md` can never write to the clipboard — on the GitHub mobile app its
# fenced blocks have no copy affordance at all, leaving long-press text
# selection as the only way to grab a task's command. The HTML page carries a
# real copy button instead: one tap and the command is on the clipboard, ready
# to paste into a Claude Code chat. It is also where a review is done — the
# board is read on a phone as often as on the laptop.
#
# The file itself is rendered by PyAutoBrain's cortex conductor alongside
# `dashboard.md` (one census, two pages) and kept fresh by the same self-heal in
# `dashboard_refresh.yml`; this workflow only publishes it.
# Only the uploaded files reach Pages — nothing else in the repo, and in
# particular not `projects/` or `projects.yaml`, whose absolute laptop
# paths are not for a public site.
# The same render writes `state.json`, the organ-cockpit feed (PyAutoBrain
# board/_state.py v1, PyAutoBrain#418); it is published at /state.json after
# validating against the Brain's contract.
on:
push:
branches: [main]
paths:
- "dashboard.html"
- "state.json"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
# The cockpit-feed contract lives with the Brain (board/_state.py); the
# Cortex only publishes what the Brain's cortex renderer wrote.
- uses: actions/checkout@v4
with:
repository: PyAutoLabs/PyAutoBrain
path: PyAutoBrain
# enablement: true creates the Pages site on first run, so no manual
# Settings → Pages step is needed.
- uses: actions/configure-pages@v5
with:
enablement: true
- name: stage the dashboard as the site index
run: |
mkdir -p _site
cp dashboard.html _site/index.html
# The organ-cockpit feed, when the renderer has written it.
if [ -f state.json ]; then cp state.json _site/state.json; fi
# A feed that has drifted from the contract fails the job here, before
# Pages publishes something the cockpit would reject.
- name: Validate the cockpit feed against the Brain contract
run: |
if [ -f _site/state.json ]; then
python3 PyAutoBrain/board/_state.py _site/state.json
else
echo "no state.json rendered yet — nothing to validate"
fi
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v4