-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (42 loc) · 1.25 KB
/
deploy.yml
File metadata and controls
52 lines (42 loc) · 1.25 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
# 构建 VitePress 站点并将其部署到 Cloudflare Pages
#
name: Deploy NiceGUI docs site to Cloudflare Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build with VitePress
run: pnpm docs:build
- name: Copy static files
run: |
if [ -d "./docs/static/" ]; then
cp -r ./docs/static/* ./docs/.vitepress/dist/
echo "Static files copied successfully"
else
echo "Warning: ./docs/static/ directory not found, skipping copy step"
fi
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs/.vitepress/dist --project-name=nicegui