-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (48 loc) · 1.3 KB
/
deploy-docs.yml
File metadata and controls
56 lines (48 loc) · 1.3 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
#
name: Deploy VitePress site to Pages
on:
push:
branches:
- main
- feat/docs
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
# 允许你从 Actions 选项卡手动运行此工作流程
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install dependencies
run: |
cd docs
echo "Check current directory"
pwd
npm ci
- name: Build with VitePress
run: |
cd docs
echo "Check current directory"
pwd
npm run docs:build
- name: Deploy to feat/deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
publish_branch: feat/deploy
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy docs to feat/deploy'