Skip to content

Commit 43cc437

Browse files
committed
chore: replace legacy docs workflow with unified GitHub Pages deployment, update docs
1 parent 9aaf802 commit 43cc437

7 files changed

Lines changed: 3660 additions & 5 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
env:
1010
BUILD_TYPE: Release
1111

12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: ci-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1219
jobs:
1320
build:
1421
name: ${{ matrix.os }} - ${{ matrix.compiler }}
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ on:
1212
- "CONTRIBUTING.md"
1313
- "CONTRIBUTING.zh.md"
1414
- "book.json"
15-
- ".github/workflows/docs.yml"
15+
- ".gitbook.yaml"
16+
- "package.json"
17+
- "package-lock.json"
18+
- ".github/workflows/pages.yml"
1619
workflow_dispatch:
1720

1821
permissions:
@@ -29,13 +32,35 @@ jobs:
2932
runs-on: ubuntu-latest
3033
steps:
3134
- uses: actions/checkout@v4
35+
with:
36+
sparse-checkout: |
37+
docs/en
38+
docs/zh
39+
examples/01-cmake-modern/README.md
40+
examples/02-memory-cache/README.md
41+
examples/03-modern-cpp/README.md
42+
examples/04-simd-vectorization/README.md
43+
examples/05-concurrency/README.md
44+
README.md
45+
README.zh-CN.md
46+
SUMMARY.md
47+
CONTRIBUTING.md
48+
CONTRIBUTING.zh.md
49+
book.json
50+
.gitbook.yaml
51+
package.json
52+
package-lock.json
53+
54+
- name: Setup Pages
55+
uses: actions/configure-pages@v5
3256

3357
- uses: actions/setup-node@v4
3458
with:
35-
node-version: 20
59+
node-version: 22
60+
cache: npm
3661

3762
- name: Install honkit
38-
run: npm install honkit
63+
run: npm ci
3964

4065
- name: Build docs
4166
run: npx honkit build . _site

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ English | [简体中文](README.zh-CN.md) | [GitBook Sync Guide](docs/en/gitbook
55
[![Build](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/build.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=white&label=Build)](https://github.com/LessUp/cpp-high-performance-guide/actions/workflows/build.yml)
66
[![Benchmarks](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/benchmark.yml?branch=main&style=for-the-badge&logo=speedtest&logoColor=white&label=Benchmarks)](https://github.com/LessUp/cpp-high-performance-guide/actions/workflows/benchmark.yml)
77
[![Sanitizers](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/sanitizers.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=white&label=Sanitizers)](https://github.com/LessUp/cpp-high-performance-guide/actions/workflows/sanitizers.yml)
8-
[![Docs](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/docs.yml?branch=main&style=for-the-badge&logo=githubpages&logoColor=white&label=Docs)](https://lessup.github.io/cpp-high-performance-guide/)
8+
[![Docs](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/pages.yml?branch=main&style=for-the-badge&logo=githubpages&logoColor=white&label=Docs)](https://lessup.github.io/cpp-high-performance-guide/)
99

1010
A comprehensive collection of high-performance computing optimization examples and best practices for modern C++20.
1111

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Build](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/build.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=white&label=Build)](https://github.com/LessUp/cpp-high-performance-guide/actions/workflows/build.yml)
66
[![Benchmarks](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/benchmark.yml?branch=main&style=for-the-badge&logo=speedtest&logoColor=white&label=Benchmarks)](https://github.com/LessUp/cpp-high-performance-guide/actions/workflows/benchmark.yml)
77
[![Sanitizers](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/sanitizers.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=white&label=Sanitizers)](https://github.com/LessUp/cpp-high-performance-guide/actions/workflows/sanitizers.yml)
8-
[![Docs](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/docs.yml?branch=main&style=for-the-badge&logo=githubpages&logoColor=white&label=Docs)](https://lessup.github.io/cpp-high-performance-guide/)
8+
[![Docs](https://img.shields.io/github/actions/workflow/status/LessUp/cpp-high-performance-guide/pages.yml?branch=main&style=for-the-badge&logo=githubpages&logoColor=white&label=Docs)](https://lessup.github.io/cpp-high-performance-guide/)
99

1010
面向现代 C++20 的高性能计算优化示例与最佳实践合集。
1111

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 2026-03-10 GitHub Pages 优化
2+
3+
## 变更
4+
5+
### GitHub Pages 工作流优化 (`pages.yml`)
6+
- **Sparse-checkout**:仅检出文档相关文件(docs/、examples/*/README.md、README.md 等),跳过 tests/、benchmarks/、cmake/、src/ 等大目录,显著减少 CI 检出时间和磁盘占用。
7+
- **npm 缓存**`actions/setup-node` 启用 `cache: npm`,后续构建复用 node_modules 缓存,加速 honkit 安装。
8+
- **锁定 HonKit 版本**:新增 `package.json` + `package-lock.json`,将 honkit 固定为 `^3.7.1`,使用 `npm ci` 替代 `npm install`,确保可复现构建。
9+
- **补全 paths 触发条件**:新增 `.gitbook.yaml``package.json``package-lock.json` 触发路径。
10+
11+
### Docs 徽章修复
12+
- 修复 `README.md``README.zh-CN.md` 中 Docs 徽章链接:`docs.yml``pages.yml`,与实际工作流文件名一致。
13+
14+
### 新增文件
15+
- `package.json` — 声明 honkit 开发依赖,提供 `docs:build` / `docs:serve` 脚本。
16+
- `package-lock.json` — 锁定依赖版本,支持 npm 缓存和可复现安装。
17+
18+
## 原因
19+
20+
- 原工作流每次全量检出整个仓库(含 C++ 源码、测试、基准测试),仅为构建 Markdown 文档,浪费 CI 资源。
21+
- `npm install honkit` 无版本锁定,每次构建可能安装不同版本,存在不可复现风险。
22+
- Docs 徽章引用了不存在的 `docs.yml`,导致徽章状态始终显示异常。

0 commit comments

Comments
 (0)