File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ name: docs-page-deploy
2+
3+ on:
4+ # 每当 push 到 main 分支时触发部署
5+ # push:
6+ # branches: [ next ]
7+ # 手动触发部署
8+ workflow_dispatch:
9+
10+ jobs:
11+ docs:
12+ runs-on: ubuntu-latest
13+
14+ steps:
15+ - uses: actions/checkout@v3
16+ with:
17+ # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
18+ fetch-depth: 0
19+
20+ - name: Setup pnpm
21+ uses: pnpm/action-setup@v2
22+ with:
23+ # 选择要使用的 pnpm 版本
24+ version: 6
25+ # 使用 pnpm 安装依赖
26+ run_install: true
27+
28+ - name: Setup Node.js
29+ uses: actions/setup-node@v3
30+ with:
31+ # 选择要使用的 node 版本
32+ node-version: 14.20.1
33+ # 缓存 pnpm 依赖
34+ cache: pnpm
35+
36+ # 运行构建脚本
37+ - name: Build VuePress site
38+ run: pnpm build
39+
40+ # 查看 workflow 的文档来获取更多信息
41+ # @see https://github.com/crazy-max/ghaction-github-pages
42+ - name: Deploy to GitHub Pages
43+ uses: crazy-max/ghaction-github-pages@v2
44+ with:
45+ # 部署到 gh-pages 分支
46+ target_branch: pages/github
47+ # 部署目录为 VuePress 的默认输出目录
48+ build_dir: docs/.vuepress/dist
49+ env:
50+ # @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
51+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments