32 lines
828 B
YAML
32 lines
828 B
YAML
name: 部署文档网站
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master # default branch
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
#- uses: actions/cache@v3
|
|
# id: node-modules
|
|
# with:
|
|
# path: node_modules/
|
|
# key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
|
|
# restore-keys: |
|
|
# ${{ runner.os }}-node-modules-
|
|
- name: 安装依赖
|
|
if: steps.node-modules.outputs.cache-hit != 'true'
|
|
run: yarn install --frozen-lockfile
|
|
- name: 构建网站
|
|
run: yarn run docs:build
|
|
- name: 发布网站
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
with:
|
|
branch: website
|
|
folder: docs/dist |