Skip to content

Merge pull request #1 from micro-zoe/dev #3

Merge pull request #1 from micro-zoe/dev

Merge pull request #1 from micro-zoe/dev #3

Workflow file for this run

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