-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (68 loc) · 1.94 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
84 lines (68 loc) · 1.94 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Deploy Documentation
on:
release:
types: [published]
push:
branches: [master, 'release/**']
tags: ['v*']
paths:
- 'docs/**'
- 'developer-docs/**'
- '.config/nextest.toml'
- '.github/workflows/docs-deploy.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest@0.9.143
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: docs-openapi-v1
- name: Setup bun
uses: oven-sh/setup-bun@v2
- uses: actions/configure-pages@v5
- name: Install dependencies
working-directory: docs
run: bun install --frozen-lockfile
# mermaid 构建时渲染(@beoe/rehype-mermaid)需要 chromium
- name: Install Playwright chromium
working-directory: docs
run: bunx playwright install --with-deps chromium
- name: Build documentation
working-directory: docs
run: bun run docs:build
- name: Build developer documentation
working-directory: docs
run: bun run developer-docs:build
- name: Merge developer documentation
run: mkdir -p docs/dist/developer && cp -R docs/dist-developer/. docs/dist/developer/
- uses: actions/upload-pages-artifact@v4
with:
path: docs/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4