-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.65 KB
/
generate_documentation.yml
File metadata and controls
67 lines (58 loc) · 1.65 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
name: Generate Documentation
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18] # Easily add more versions if needed
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then
python -m pip install -r requirements.txt
else
echo "No requirements.txt found, skipping Python dependency install."
fi
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Generate API documentation
run: |
if [ -d vendor ]; then
cd vendor
python APIGenerator/src/gen.py --build
else
echo "⚠️ Vendor folder not found. Skipping API generation."
fi
- name: Install and Build with npm
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
npm run build --if-present
- name: Deploy 🚀
if: success() # only deploy if build succeeds
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: gh-pages
folder: build