更新部署依赖
Build and Deploy Documentation / build-and-deploy (push) Failing after 37s Details

This commit is contained in:
guocheng 2026-07-29 20:12:37 +08:00
parent 5d7415078f
commit 1f01c61cde
4 changed files with 27 additions and 9 deletions

View File

@ -13,9 +13,21 @@ jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-act-latest runs-on: ubuntu-act-latest
defaults:
run:
working-directory: readout_program
steps: steps:
- name: Checkout - name: Checkout readout_program
uses: https://gitee.com/actions-mirror/checkout@v4 uses: https://gitee.com/actions-mirror/checkout@v4
with:
path: readout_program
- name: Checkout rbpu_datasheet
uses: https://gitee.com/actions-mirror/checkout@v4
with:
repository: ${{ github.repository_owner }}/rbpu_datasheet
path: rbpu_datasheet
- name: Configure pip mirror - name: Configure pip mirror
run: pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple run: pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
@ -24,7 +36,7 @@ jobs:
run: pip install --retries 3 -r requirements.txt run: pip install --retries 3 -r requirements.txt
- name: Build documentation - name: Build documentation
run: python doc_builder/build.py run: python build.py
- name: Deploy to Caddy - name: Deploy to Caddy
env: env:

View File

@ -10,11 +10,11 @@ Markdown 纯文本写作 + Git 版本控制 + Python 构建管道 → 自包含
### 目录结构 ### 目录结构
``` ```
project.yaml # 项目元数据与章节列表 project.yaml # 项目元数据与章节列表
build.py # 构建入口(项目根目录)
chapters/ # Markdown 章节源文件(唯一编辑目标) chapters/ # Markdown 章节源文件(唯一编辑目标)
assets/ # 图片资源 assets/ # 图片资源
data/ # 结构化数据源CSV/YAML/JSON通过 @import 引用) data/ # 结构化数据源CSV/YAML/JSON通过 @import 引用)
doc_builder/ # Python 构建工具 doc_builder/ # Python 构建工具
build.py # 构建入口
templates/ # HTML 模板 templates/ # HTML 模板
themes/ # CSS 样式 themes/ # CSS 样式
renderers/ # 自定义渲染器(@import / 代码块渲染) renderers/ # 自定义渲染器(@import / 代码块渲染)
@ -40,6 +40,12 @@ output/ # 构建产物gitignore
- **禁止绝对路径**(尤其是 Windows 盘符路径如 `D:/code/...` - **禁止绝对路径**(尤其是 Windows 盘符路径如 `D:/code/...`
- 构建时自动内嵌为 base64生成自包含 HTML - 构建时自动内嵌为 base64生成自包含 HTML
### README 规范
- README.md 必须包含 **CI/CD 状态徽章**(指向 Gitea Actions workflow 的 badge URL
- README.md 必须包含 **在线文档/部署链接**,指向文档的实际访问地址
- 徽章格式: `[![Build Status](<gitea_server>/<org>/<repo>/actions/workflows/<workflow>.yml/badge.svg)](<gitea_server>/<org>/<repo>/actions)`
- 部署链接格式: `📖 **在线文档**: [<url>](<url>)`
### 交叉引用 ### 交叉引用
- 内部引用: `详见 [标题锚点](#标题锚点)` - 内部引用: `详见 [标题锚点](#标题锚点)`
- 外部引用: `[文档名](path/to/doc.md)` - 外部引用: `[文档名](path/to/doc.md)`
@ -58,7 +64,7 @@ output/ # 构建产物gitignore
pip install -r requirements.txt pip install -r requirements.txt
# 构建 HTML # 构建 HTML
python doc_builder/build.py python build.py
# 输出: output/<标题>.html # 输出: output/<标题>.html
``` ```
@ -91,7 +97,7 @@ python doc_builder/build.py
| 修改内容 | 编辑目标 | 构建方式 | | 修改内容 | 编辑目标 | 构建方式 |
|:---|:---|:---| |:---|:---|:---|
| 正文内容 | `chapters/*.md` | `python doc_builder/build.py` | | 正文内容 | `chapters/*.md` | `python build.py` |
| 章节顺序 | `project.yaml``chapters:` 列表 | 同上 | | 章节顺序 | `project.yaml``chapters:` 列表 | 同上 |
| 图片 | `assets/` | 同上(自动内嵌) | | 图片 | `assets/` | 同上(自动内嵌) |
| 结构化数据 | `data/*.csv` / `data/*.yaml` / `data/*.json` | 同上(通过 @import 注入) | | 结构化数据 | `data/*.csv` / `data/*.yaml` / `data/*.json` | 同上(通过 @import 注入) |

View File

@ -18,11 +18,11 @@
``` ```
project.yaml # 项目配置(标题、作者、版本、章节列表) project.yaml # 项目配置(标题、作者、版本、章节列表)
build.py # 构建入口(项目根目录)
chapters/ # Markdown 章节源文件 chapters/ # Markdown 章节源文件
assets/ # 图片资源 assets/ # 图片资源
data/ # 结构化数据源CSV/YAML/JSON通过 @import 引用) data/ # 结构化数据源CSV/YAML/JSON通过 @import 引用)
doc_builder/ # Python 构建工具 doc_builder/ # Python 构建工具
build.py # 构建入口
templates/ # HTML 模板(含 A4 封面) templates/ # HTML 模板(含 A4 封面)
themes/ # CSS 样式(屏幕 + 打印) themes/ # CSS 样式(屏幕 + 打印)
renderers/ # 自定义渲染器(@import / 代码块) renderers/ # 自定义渲染器(@import / 代码块)
@ -40,7 +40,7 @@ output/ # 构建产物(.gitignore
pip install -r requirements.txt pip install -r requirements.txt
# 2. 构建 # 2. 构建
python doc_builder/build.py python build.py
# 3. 打开 output/<标题>.html 即可浏览 # 3. 打开 output/<标题>.html 即可浏览
``` ```

View File

@ -6,7 +6,7 @@ Docs as Code — 构建入口
组装 注入锚点 提取目录 模板渲染 自包含 HTML 报告 组装 注入锚点 提取目录 模板渲染 自包含 HTML 报告
用法: 用法:
python doc_builder/build.py python build.py
输出: 输出:
output/<标题>.html 自包含 HTML可离线分发 output/<标题>.html 自包含 HTML可离线分发
@ -27,7 +27,7 @@ import yaml
from jinja2 import Environment, FileSystemLoader, select_autoescape from jinja2 import Environment, FileSystemLoader, select_autoescape
# ---------- 路径配置 ---------- # ---------- 路径配置 ----------
PROJECT_ROOT = Path(__file__).resolve().parent.parent PROJECT_ROOT = Path(__file__).resolve().parent
CHAPTERS_DIR = PROJECT_ROOT / "chapters" CHAPTERS_DIR = PROJECT_ROOT / "chapters"
ASSETS_DIR = PROJECT_ROOT / "assets" ASSETS_DIR = PROJECT_ROOT / "assets"
OUTPUT_DIR = PROJECT_ROOT / "output" OUTPUT_DIR = PROJECT_ROOT / "output"