chore(site): GSC 所有权验证文件 #77
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| # 中文翻译版的轻量 CI: | |
| # 1. 验证站点能正常构建(node site/build.js 生成 data.js) | |
| # 2. 课程数一致性校验(node site/build.js --check)——防 README/ROADMAP 课数漂移 | |
| # (曾踩 435 / 498 vs 503)。真相 = 文件系统课程目录数,校验 README 表格/badge/散文 | |
| # + ROADMAP 总计是否都对得上。 | |
| # 不照搬上游 scripts/audit_lessons.py + check_readme_counts.py(它们硬编码 docs/en.md | |
| # + 英文 README 正则,对中文仓全不兼容,且是 B 类 1:1 同步资产,改了会与上游冲突)—— | |
| # 改用 build.js 自带的 --check 做等价校验,认 zh.md、匹配中文文案,不碰上游 Python 脚本。 | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "site/**" | |
| - "README.md" | |
| - "ROADMAP.md" | |
| - "glossary/**" | |
| - "phases/**" | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: build site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: build data.js | |
| run: node site/build.js | |
| - name: verify output | |
| run: | | |
| test -f site/data.js || { echo "data.js 未生成"; exit 1; } | |
| grep -q "const PHASES" site/data.js || { echo "PHASES 缺失"; exit 1; } | |
| echo "✅ 站点构建成功,data.js 已生成" | |
| - name: 课程数一致性校验(防 README/ROADMAP 课数漂移) | |
| run: node site/build.js --check |