This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
更新失效链接 #31
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: docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
workflow_dispatch: | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
NODE_VERSION: '16' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Handle yarn cache | |
uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-yarn- | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: | | |
cd docs | |
yarn --frozen-lockfile | |
- name: Build documentation site | |
run: | | |
cd docs | |
yarn vuepress build | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v2.2.0 | |
with: | |
repo: liuran001/GJZS | |
target_branch: gh_page | |
build_dir: docs/.vuepress/dist | |
env: | |
GH_PAT: ${{ secrets.GH_PAGES_TOKEN }} |