Skip to content

Commit 4e279da

Browse files
authored
Create blank.yml
1 parent ed891ca commit 4e279da

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/blank.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: docs
2+
3+
on:
4+
# 每当 push 到 main 分支时触发部署
5+
push:
6+
branches: [main]
7+
# 手动触发部署
8+
workflow_dispatch:
9+
10+
jobs:
11+
docs:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
18+
fetch-depth: 0
19+
20+
- name: 设置 Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
25+
- name: 安装依赖
26+
uses: borales/actions-yarn@v4
27+
with:
28+
cmd: install
29+
- name: 构建页面
30+
uses: borales/actions-yarn@v4
31+
with:
32+
cmd: docs:build
33+
34+
# 查看 workflow 的文档来获取更多信息
35+
# @see https://github.com/crazy-max/ghaction-github-pages
36+
- name: 部署到 GitHub Pages
37+
uses: crazy-max/ghaction-github-pages@v4
38+
with:
39+
# 部署到 docs 分支
40+
target_branch: docs
41+
# 部署目录为 VuePress 的默认输出目录
42+
build_dir: docs/.vuepress/dist
43+
env:
44+
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)