1+ name : Deploy Documentation to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ paths :
7+ - ' include/**'
8+ - ' examples/**'
9+ - ' docs/**'
10+ - ' Doxyfile'
11+ - ' tools/scripts/build_docs.sh'
12+
13+ permissions :
14+ contents : read
15+ pages : write
16+ id-token : write
17+
18+ # Allow only one concurrent deployment
19+ concurrency :
20+ group : " pages"
21+ cancel-in-progress : false
22+
23+ jobs :
24+ build :
25+ runs-on : ubuntu-latest
26+
27+ steps :
28+ - name : Checkout code
29+ uses : actions/checkout@v4
30+
31+ - name : Setup Python
32+ uses : actions/setup-python@v4
33+ with :
34+ python-version : ' 3.11'
35+
36+ - name : Install system dependencies
37+ run : |
38+ sudo apt-get update
39+ sudo apt-get install -y doxygen graphviz plantuml
40+
41+ - name : Install Python dependencies
42+ run : |
43+ python -m pip install --upgrade pip
44+ pip install sphinx sphinx-rtd-theme breathe exhale
45+
46+ - name : Make build script executable
47+ run : chmod +x tools/scripts/build_docs.sh
48+
49+ - name : Generate documentation
50+ run : |
51+ ./tools/scripts/build_docs.sh all
52+
53+ - name : Create combined documentation site
54+ run : |
55+ mkdir -p _site
56+ cp -r docs/generated/html/* _site/
57+ mkdir -p _site/sphinx
58+ cp -r docs/sphinx/_build/html/* _site/sphinx/
59+ mkdir -p _site/api
60+ cp -r docs/api/* _site/api/
61+
62+ # Create a main index.html
63+ cat > _site/index.html << 'EOF'
64+ <!DOCTYPE html>
65+ <html>
66+ <head>
67+ <meta charset="UTF-8">
68+ <title>DiffEq Documentation</title>
69+ <meta http-equiv="refresh" content="0; url=./annotated.html">
70+ <style>
71+ body { font-family: Arial, sans-serif; margin: 40px; }
72+ .nav { background: #f5f5f5; padding: 20px; border-radius: 5px; }
73+ .nav h1 { color: #333; }
74+ .nav a { display: block; margin: 10px 0; padding: 10px; background: #007acc; color: white; text-decoration: none; border-radius: 3px; }
75+ .nav a:hover { background: #005a99; }
76+ </style>
77+ </head>
78+ <body>
79+ <div class="nav">
80+ <h1>DiffEq Documentation</h1>
81+ <p>If you are not redirected automatically, choose from:</p>
82+ <a href="./annotated.html">📚 API Reference (Doxygen)</a>
83+ <a href="./sphinx/index.html">📖 User Guide (Sphinx)</a>
84+ <a href="./api/README.md">🔧 API Documentation</a>
85+ <a href="https://github.com/WenyinWei/diffeq/tree/main/examples">💡 Examples</a>
86+ </div>
87+ </body>
88+ </html>
89+ EOF
90+
91+ - name : Setup Pages
92+ uses : actions/configure-pages@v4
93+
94+ - name : Upload artifact
95+ uses : actions/upload-pages-artifact@v3
96+ with :
97+ path : ' _site'
98+
99+ deploy :
100+ environment :
101+ name : github-pages
102+ url : ${{ steps.deployment.outputs.page_url }}
103+ runs-on : ubuntu-latest
104+ needs : build
105+
106+ steps :
107+ - name : Deploy to GitHub Pages
108+ id : deployment
109+ uses : actions/deploy-pages@v4
0 commit comments