-
Notifications
You must be signed in to change notification settings - Fork 121
38 lines (32 loc) · 910 Bytes
/
deploy-docs.yml
File metadata and controls
38 lines (32 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# .github/workflows/deploy-docs.yml
name: Deploy Docs to GitHub Pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build VitePress site
run: npm run docs:build:github
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
# 部署到 gh-pages 分支
target_branch: gh-pages
# 部署目录为 VitePress 的默认输出目录
build_dir: docs/.vitepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}