Skip to content

Commit 767832f

Browse files
committed
ci(docs): deploy VuePress to GitHub Pages
1 parent 09de734 commit 767832f

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docs (GitHub Pages)
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: docs-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "18"
25+
cache: npm
26+
cache-dependency-path: docs/package-lock.json
27+
28+
- name: Install
29+
working-directory: docs
30+
run: npm ci
31+
32+
- name: Build
33+
working-directory: docs
34+
run: npm run build
35+
36+
- name: Deploy
37+
uses: peaceiris/actions-gh-pages@v4
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
publish_branch: gh-pages
41+
publish_dir: docs/.vuepress/dist
42+
enable_jekyll: false

docs/.vuepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module.exports = {
22
lang: 'zh-CN',
33
title: 'Clasp',
44
description: 'C++17 的 Cobra-like 命令行框架(兼容行为优先)',
5+
// GitHub Pages project site base (https://<user>.github.io/<repo>/)
6+
base: '/clasp/',
57

68
themeConfig: {
79
repo: 'cuihairu/clasp',
@@ -30,4 +32,3 @@ module.exports = {
3032
},
3133
},
3234
}
33-

0 commit comments

Comments
 (0)