-
Notifications
You must be signed in to change notification settings - Fork 29
46 lines (40 loc) · 1.52 KB
/
blank.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
38
39
40
41
42
43
44
45
name: CI
# 控制如何触发事件,这里针对 master 分支
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 一个工作流运行是由一个或多个作业组成的,这些作业可以连续或并行运行。
jobs:
# 该工作流包含一个名为 "build " 的单一工作。
build:
# 工作要运行的运行器类型。
runs-on: ubuntu-latest
# 步骤代表了作为工作的一部分将要执行的任务序列
steps:
# 签出你在 $GITHUB_WORKSPACE 下的仓库,这样你的工作就可以访问它。
- uses: actions/checkout@v3
# 缓存 yarn 的依赖?
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` aac(`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# 设置 nodejs 版本为 14.x,太高会运行出错
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: yarn run docs:build
run: yarn install && yarn run docs:build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/.vuepress/dist