up/.forgejo/workflows/docs.yml
Tolaria 69f69be5e4 fix(action-points): correct nav badges, first-load totals, legibility
- Fix nav badge mis-targeting: scope to .md-nav--primary, skip #anchor
  (TOC) links so 'On this page' entries no longer show the page total;
  detect active-leaf sections via md-nav__item--nested instead of the
  secondary (TOC) nav, so the active page gets its own badge.
- Add build-time totals manifest (main.py -> docs/javascripts/toa-totals.json)
  so nav badges show correct totals on first load before a user has
  visited each page. Fetched once, browser-cached, zero runtime cost.
  Wired into CI before zensical build.
- Exclude fenced code blocks when counting tasks, so the Markdown
  reference doc's example checkboxes don't produce a phantom 0/3 badge.
- Force white text (#fff !important) on completed green pills/badges,
  incl. badge-inside-complete-link, to beat the nav link's green color.
- Convert prose practice/strategy steps into interactive tasklist items.
- Add action-points PRD under planning/.
2026-06-03 23:03:17 +08:00

50 lines
No EOL
1.3 KiB
YAML

name: Deploy Docs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
apt-get update && apt-get install -y python3 python3-pip python3-venv
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
python3 --version
pip3 install zensical
pip3 install -e .
- run: |
. /tmp/venv/bin/activate
python3 main.py
zensical build --clean
- name: Deploy to pages branch
run: |
set -e
git config user.name "forgejo-actions"
git config user.email "forgejo-actions@noreply.local"
git fetch origin pages
git worktree add /tmp/pages-deploy origin/pages
cd /tmp/pages-deploy
git rm -rf --ignore-unmatch .
cp -r "$GITHUB_WORKSPACE"/site/* .
cp "$GITHUB_WORKSPACE"/site/.[!.]* . 2>/dev/null || true
git add .
if ! git diff --staged --quiet; then
git commit -m "deploy: zensical build from ${GITHUB_SHA::7}"
git push origin HEAD:pages
else
echo "No changes to deploy"
fi
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
GITHUB_SHA: ${{ github.sha }}