Skip to content

Commit 4e424dc

Browse files
Merge pull request #2 from Awesome-Embedded-Learning-Studio/feat/migrate_to_vitepress
update the project ci
2 parents 156a077 + d445d1c commit 4e424dc

7 files changed

Lines changed: 2813 additions & 106 deletions

File tree

.github/workflows/cpp-check.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: C++ Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
linux-build-test:
18+
name: Linux build and tests
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Build Docker image
26+
run: |
27+
docker build \
28+
--platform linux/amd64 \
29+
--build-arg QT_ARCH=linux_gcc_64 \
30+
-f scripts/docker/Dockerfile.build \
31+
-t cfdesktop-build \
32+
.
33+
34+
- name: Configure, build, and test
35+
run: |
36+
docker run --rm \
37+
--platform linux/amd64 \
38+
-e QT_QPA_PLATFORM=offscreen \
39+
-v "$PWD:/project" \
40+
-w /project \
41+
cfdesktop-build \
42+
bash -lc "bash scripts/build_helpers/linux_develop_build.sh ci -c build_ci_config.ini && bash scripts/build_helpers/linux_run_tests.sh ci -c build_ci_config.ini"
43+
44+
docs-build:
45+
name: VitePress docs build
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 24
56+
cache: npm
57+
58+
- name: Install dependencies
59+
run: npm ci
60+
61+
- name: Build docs
62+
run: npm run docs:build

.github/workflows/deploy.yml

Lines changed: 37 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,56 @@
1-
# 工作流名称
2-
name: 自动部署 MkDocs
1+
name: Deploy VitePress
32

4-
# 触发条件:推送到 main 分支
53
on:
64
push:
75
branches:
86
- main
9-
10-
# 允许手动触发
117
workflow_dispatch:
128

13-
# 设置权限
149
permissions:
15-
contents: write # 允许推送到 gh-pages 分支
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
1617

1718
jobs:
18-
deploy:
19+
build:
1920
runs-on: ubuntu-latest
20-
21+
2122
steps:
22-
# 1. 检出代码
23-
- name: 检出仓库
23+
- name: Checkout
2424
uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 0 # 获取完整历史,显示文章修改时间
27-
28-
# 2. 设置 Python
29-
- name: 设置 Python
30-
uses: actions/setup-python@v5
31-
with:
32-
python-version: "3.11"
33-
# cache: 'pip' # 缓存依赖,加速构建
34-
35-
# 3. 安装依赖
36-
- name: 安装依赖
37-
run: |
38-
pip install mkdocs-material
39-
pip install mkdocs-awesome-pages-plugin
40-
pip install mkdocs-git-revision-date-localized-plugin
41-
42-
# 4. 安装 Doxygen
43-
- name: 安装 Doxygen
44-
run: |
45-
sudo apt-get update
46-
sudo apt-get install -y doxygen
4725

48-
# 5. 安装 doxybook2
49-
- name: 安装 doxybook2
50-
run: |
51-
# 下载最新版本的 doxybook2
52-
DOXYBOOK2_VERSION="1.5.0"
53-
wget https://github.com/matusnovak/doxybook2/releases/download/v${DOXYBOOK2_VERSION}/doxybook2-linux-amd64-v${DOXYBOOK2_VERSION}.zip
54-
unzip doxybook2-linux-amd64-v${DOXYBOOK2_VERSION}.zip
55-
sudo mv bin/doxybook2 /usr/local/bin/
56-
sudo chmod +x /usr/local/bin/doxybook2
57-
doxybook2 --version
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 24
30+
cache: npm
5831

59-
# 6. 生成 API 文档(Doxygen → Markdown)
60-
- name: 生成 API 文档
61-
run: |
62-
doxygen Doxyfile
63-
rm -rf document/api
64-
mkdir -p document/api
65-
doxybook2 --input ./xml \
66-
--output ./document/api \
67-
--config doxybook.json
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v5
6834

69-
# 6.5. 为自动生成的 API 文档配置导航
70-
- name: 配置 API 导航
71-
run: |
72-
cat > document/api/.pages <<'EOF'
73-
title: API 自动文档
74-
icon: material/file-document
75-
nav:
76-
- 命名空间: Namespaces
77-
- 类: Classes
78-
- 文件: Files
79-
EOF
35+
- name: Install dependencies
36+
run: npm ci
8037

81-
# 6.6. 修复 doxybook2 生成的相对链接路径
82-
- name: 修复 API 文档链接
83-
run: python3 scripts/document/fix_doxybook_links.py
38+
- name: Build docs
39+
run: npm run docs:build
8440

85-
# 7. 构建网站
86-
- name: 构建网站
87-
run: mkdocs build --clean
88-
89-
# 8. 自动部署到 gh-pages 分支(这一步会自动触发 GitHub Pages)
90-
- name: 部署到 GitHub Pages
91-
uses: peaceiris/actions-gh-pages@v4
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
9243
with:
93-
github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub 自动提供的 token
94-
publish_dir: ./site # MkDocs 构建输出目录
44+
path: document/.vitepress/dist
45+
46+
deploy:
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
needs: build
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.github/workflows/docs-check.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Docs Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
- labeled
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
vitepress:
18+
name: VitePress build
19+
if: contains(github.event.pull_request.labels.*.name, 'build-doc')
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 24
30+
cache: npm
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build docs
36+
run: npm run docs:build

.gitignore

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
# ignores
2-
.cache
3-
.claude
4-
5-
# aqtinstall log
6-
aqtinstall.log
7-
# privates
8-
BLUEPRINT.md
9-
10-
# native builds
11-
out/
12-
13-
# Documents summons
14-
xml/
15-
site/
16-
document/api/
17-
18-
# .vscode
19-
.vscode
20-
21-
# third_party dependencies (downloaded during configuration)
22-
third_party/*/
23-
!third_party/.gitkeep
24-
25-
__pycache__/
26-
27-
# Python virtual environment
28-
.venv/
29-
30-
# Docker build logs
31-
scripts/docker/logger/
1+
# ignores
2+
.cache
3+
.claude
4+
CLAUDE.md
5+
MEMORY.md
6+
7+
# aqtinstall log
8+
aqtinstall.log
9+
# privates
10+
BLUEPRINT.md
11+
12+
# native builds
13+
out/
14+
15+
# Documents summons
16+
xml/
17+
site/
18+
document/api/
19+
20+
# .vscode
21+
.vscode
22+
23+
# third_party dependencies (downloaded during configuration)
24+
third_party/*/
25+
!third_party/.gitkeep
26+
27+
__pycache__/
28+
29+
# Python virtual environment
30+
.venv/
31+
32+
# Docker build logs
33+
scripts/docker/logger/
34+
35+
# Node/VitePress
36+
node_modules/
37+
document/.vitepress/cache/
38+
document/.vitepress/dist/
39+
document/.vitepress/.temp

document/.vitepress/config.mts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { defineConfig } from "vitepress";
2+
3+
export default defineConfig({
4+
title: "CFDesktop",
5+
description: "A Qt-based Material Design 3 desktop framework for embedded devices.",
6+
base: "/CFDesktop/",
7+
cleanUrls: true,
8+
lastUpdated: true,
9+
ignoreDeadLinks: true,
10+
srcExclude: ["api/**"],
11+
markdown: {
12+
html: false
13+
},
14+
themeConfig: {
15+
nav: [
16+
{ text: "Start Here", link: "/" },
17+
{ text: "Development", link: "/development/" },
18+
{ text: "Architecture", link: "/design_stage/system_architecture_overview" },
19+
{ text: "Desktop Roadmap", link: "/todo/desktop/" },
20+
{ text: "HandBook", link: "/HandBook/" }
21+
],
22+
sidebar: [
23+
{
24+
text: "Start Here",
25+
items: [
26+
{ text: "Overview", link: "/" },
27+
{ text: "Current TODO", link: "/todo/" }
28+
]
29+
},
30+
{
31+
text: "Development",
32+
items: [
33+
{ text: "Guide", link: "/development/" },
34+
{ text: "Prerequisites", link: "/development/01_prerequisites" },
35+
{ text: "Quick Start", link: "/development/02_quick_start" },
36+
{ text: "Build System", link: "/development/03_build_system" },
37+
{ text: "CI", link: "/ci/" }
38+
]
39+
},
40+
{
41+
text: "Architecture",
42+
items: [
43+
{ text: "System Overview", link: "/design_stage/system_architecture_overview" },
44+
{ text: "Display Backend", link: "/design_stage/multi_display_backend_architecture" },
45+
{ text: "Desktop", link: "/desktop/" }
46+
]
47+
},
48+
{
49+
text: "Roadmap",
50+
items: [
51+
{ text: "Desktop Overview", link: "/todo/desktop/" },
52+
{ text: "Milestones", link: "/todo/desktop/milestone_00_overview" },
53+
{ text: "Done", link: "/todo/done/" }
54+
]
55+
},
56+
{
57+
text: "HandBook",
58+
items: [
59+
{ text: "HandBook", link: "/HandBook/" },
60+
{ text: "Base", link: "/HandBook/base/" },
61+
{ text: "UI", link: "/HandBook/ui/" },
62+
{ text: "Desktop", link: "/HandBook/desktop/" }
63+
]
64+
}
65+
],
66+
socialLinks: [
67+
{ icon: "github", link: "https://github.com/Awesome-Embedded-Learning-Studio/CFDesktop" }
68+
],
69+
search: {
70+
provider: "local"
71+
}
72+
}
73+
});

0 commit comments

Comments
 (0)