-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (96 loc) · 2.56 KB
/
docs.yml
File metadata and controls
112 lines (96 loc) · 2.56 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Documentation
on:
push:
branches: [ main ]
paths:
- 'src/**'
- 'website/**'
- 'build.zig'
- '.github/workflows/docs.yml'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'website/**'
- 'build.zig'
env:
ZIG_VERSION: 0.14.1
NODE_VERSION: 18
jobs:
generate-docs:
name: Generate API Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y \
build-essential \
cmake \
libboost-all-dev \
libssl-dev \
pkg-config
- name: Generate Zig documentation
run: |
echo "🔨 Generating Zig documentation..."
zig build docs
echo "✅ Documentation generated"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Install website dependencies
run: |
cd website
pnpm install
- name: Copy API docs to website
run: |
echo "📁 Copying API documentation to website..."
mkdir -p website/static/api-docs
cp -r zig-out/docs/* website/static/api-docs/
echo "✅ API docs copied"
- name: Build website
run: |
cd website
pnpm build
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: |
zig-out/docs/
website/build/
deploy-docs:
name: Deploy Documentation
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: generate-docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Download documentation artifacts
uses: actions/download-artifact@v4
with:
name: documentation
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: website/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4