Skip to content

Commit a839a09

Browse files
committed
Add GitHub Pages deployment workflow
- Add automated VitePress site deployment to GitHub Pages - Configure workflow to trigger on docs changes and manual dispatch - Set up proper permissions and artifact handling - Enable automatic documentation publishing on master branch
1 parent 4ac797f commit a839a09

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy VitePress site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/deploy-docs.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 18
34+
cache: npm
35+
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v4
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Build with VitePress
43+
run: npm run docs:build
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: docs/.vitepress/dist
49+
50+
deploy:
51+
needs: build
52+
runs-on: ubuntu-latest
53+
permissions:
54+
pages: write
55+
id-token: write
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)