Skip to content

Merge pull request #6 from LiuqingDu/patch-1 #79

Merge pull request #6 from LiuqingDu/patch-1

Merge pull request #6 from LiuqingDu/patch-1 #79

Workflow file for this run

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