-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1.33 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# .github > workflows > deploy.yml
name: deployForPage
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- run: npm install --frozen-lockfile
- name: Build
run: npm run docs:build
- name: Deploy
# 将构建产物 commit 到一个分支上,用于发布静态站点资源
# https://github.com/peaceiris/actions-gh-pages
#不要将peaceiris改为自己的仓库名,我单纯的以为这个需要改成自己的仓库名,部署上去就build失败了,需引用该仓库的配置
uses: peaceiris/actions-gh-pages@v3
with:
# Github 会在 workflow 中自动生成 GIHUBT_TOKEN,用于认证 workflow 的运行
github_token: ${{ secrets.GITHUB_TOKEN }}
# 静态资源目录设置
publish_dir: docs/.vitepress/dist
# 默认发布到 gh-pages 分支上,可以指定特定的发布分支(不能选拉取代码的分支)
publish_branch: gh-pages
full_commit_message: ${{ github.event.head_commit.message }}