Skip to content

Commit 409044a

Browse files
committed
docs: 补充ci.yml注释;
1 parent 12ecca4 commit 409044a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1+
# 标题
12
name: GitHub Actions 部署 vitepress 博客
3+
# 触发时机:表示推送master分支时触发
24
on:
35
push:
46
branches:
57
- master
8+
# 任务列表
69
jobs:
710
build-and-deploy:
11+
# 运行环境
812
runs-on: ubuntu-latest
13+
# 步骤
914
steps:
15+
# 步骤1:安装Node.js
1016
- name: Setup Node.js
1117
uses: actions/setup-node@v4
1218
with:
1319
node-version: 20
20+
# 步骤2:检出代码
1421
- name: Checkout
1522
uses: actions/checkout@v4
23+
# 步骤3:安装yarn
1624
- name: Install yarn
1725
run: npm install -g yarn
26+
# 步骤4:安装依赖
1827
- name: Install dependencies
1928
run: yarn install
29+
# 步骤5:构建VitePress
2030
- name: Build VitePress
2131
run: yarn run docs:build
32+
# 步骤6:部署到Github Pages
2233
- name: Deploy to Github Pages
2334
uses: peaceiris/actions-gh-pages@v3
2435
with:
25-
github_token: ${{ secrets.VITEPRESS_BLOG_TOKEN }}
26-
publish_dir: .vitepress/dist
27-
publish_branch: gh-pages
28-
dotfiles: true
36+
github_token: ${{ secrets.VITEPRESS_BLOG_TOKEN }} # 自定义的action环境变量
37+
publish_dir: .vitepress/dist # 指定部署目录
38+
publish_branch: gh-pages # 指定部署分支
39+
dotfiles: true # 允许使用.gitignore文件

0 commit comments

Comments
 (0)