-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (43 loc) · 1.08 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
38
39
40
41
42
43
44
45
46
name: Deploy Docs
on:
push:
branches:
- master
jobs:
deploy:
name: build-and-deploy
runs-on: ubuntu-latest
steps:
# clone 源码到工作流中
- name: clone code
uses: actions/checkout@v4
with:
fetch-depth: 0
# 安装 node 环境
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- name: cache dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# 安装依赖
- name: install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
# 运行构建脚本
- name: run build script
run: yarn build
# 部署
- name: deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
FOLDER: docs/.vuepress/dist