Merge pull request #16 from zq99299/zq99299-patch-1 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# 控制如何触发事件,这里针对 master 分支 | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# 一个工作流运行是由一个或多个作业组成的,这些作业可以连续或并行运行。 | |
jobs: | |
# 该工作流包含一个名为 "build " 的单一工作。 | |
build: | |
# 工作要运行的运行器类型。 | |
runs-on: ubuntu-latest | |
# 步骤代表了作为工作的一部分将要执行的任务序列 | |
steps: | |
# 签出你在 $GITHUB_WORKSPACE 下的仓库,这样你的工作就可以访问它。 | |
- uses: actions/checkout@v2 | |
# 缓存 yarn 的依赖? | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
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- | |
- 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 | |