Skip to content

Commit 2e7d379

Browse files
author
yJader@mba
committed
refactor: 更新vuepress的ci到main
1 parent 5ba59d4 commit 2e7d379

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: ci on Github Pages
1+
name: Deploy MkDocs Site to GitHub Pages
22
on:
33
push:
44
branches:
5-
- main
5+
- mkdocs
66
workflow_dispatch:
77

88
jobs:
Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
name: Deploy VuePress site to GitHub Pages
22

33
on:
4-
# 每当 push 到 vuepress 分支时触发部署
5-
push:
6-
branches:
7-
- vuepress
8-
# 手动触发部署
9-
workflow_dispatch:
4+
# 每当 push 到 vuepress 分支时触发部署
5+
push:
6+
branches:
7+
- vuepress
8+
- main
9+
# 手动触发部署
10+
workflow_dispatch:
1011

1112
jobs:
12-
docs:
13-
runs-on: ubuntu-latest
13+
docs:
14+
runs-on: ubuntu-latest
1415

15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
19-
fetch-depth: 0
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
20+
fetch-depth: 0
2021

21-
- name: Setup pnpm
22-
uses: pnpm/action-setup@v4
23-
with:
24-
# 选择要使用的 pnpm 版本 (匹配 package.json 中的 packageManager)
25-
version: "10.24.0"
26-
# 使用 pnpm 安装依赖
27-
run_install: true
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
# 选择要使用的 pnpm 版本 (匹配 package.json 中的 packageManager)
26+
version: "10.24.0"
27+
# 使用 pnpm 安装依赖
28+
run_install: true
2829

29-
- name: Setup Node.js
30-
uses: actions/setup-node@v4
31-
with:
32-
# 选择要使用的 node 版本
33-
node-version: 22
34-
# 缓存 pnpm 依赖
35-
cache: pnpm
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
# 选择要使用的 node 版本
34+
node-version: 22
35+
# 缓存 pnpm 依赖
36+
cache: pnpm
3637

37-
# 运行构建脚本
38-
- name: Build VuePress site
39-
run: pnpm docs:build
38+
# 运行构建脚本
39+
- name: Build VuePress site
40+
run: pnpm docs:build
4041

41-
# 查看 workflow 的文档来获取更多信息
42-
# @see https://github.com/crazy-max/ghaction-github-pages
43-
- name: Deploy to GitHub Pages
44-
uses: crazy-max/ghaction-github-pages@v4
45-
with:
46-
# 部署到 gh-pages 分支
47-
target_branch: gh-pages
48-
# 部署目录为 VuePress 的默认输出目录
49-
build_dir: docs/.vuepress/dist
50-
env:
51-
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
# 查看 workflow 的文档来获取更多信息
43+
# @see https://github.com/crazy-max/ghaction-github-pages
44+
- name: Deploy to GitHub Pages
45+
uses: crazy-max/ghaction-github-pages@v4
46+
with:
47+
# 部署到 gh-pages 分支
48+
target_branch: gh-pages
49+
# 部署目录为 VuePress 的默认输出目录
50+
build_dir: docs/.vuepress/dist
51+
env:
52+
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)