-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.25 KB
/
Copy pathdocumentation.yml
File metadata and controls
88 lines (76 loc) · 2.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
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
name: Documentation
on:
push:
branches: [ main ]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints
- name: Build documentation
run: |
# Create docs build directory
mkdir -p _build/html
# Use sphinx to build documentation
# If sphinx-build is not available, create a simple copy
if ! command -v sphinx-build &> /dev/null; then
echo "Sphinx not available, creating simple documentation site"
mkdir -p _build/html/docs
cp -r docs/* _build/html/docs/
cp -r examples/ _build/html/examples/
# Create a basic index
cat > _build/html/index.html << EOF
<!DOCTYPE html>
<html>
<head>
<title>DRIFT Documentation</title>
<style>
body { font-family: Arial, sans-serif; margin: 40px; }
h1 { color: #2e8b57; }
ul { line-height: 1.8; }
</style>
</head>
<body>
<h1>DRIFT Documentation</h1>
<h2>Available Documents:</h2>
<ul>
<li><a href="docs/tutorial.html">Tutorial</a></li>
<li><a href="docs/api_reference.html">API Reference</a></li>
<li><a href="docs/validation.html">Validation</a></li>
<li><a href="docs/scientific_validation.html">Scientific Validation</a></li>
<li><a href="docs/comparison_tools.html">Tool Comparison</a></li>
<li><a href="examples/">Examples</a></li>
</ul>
</body>
</html>
EOF
else
sphinx-build -b html docs _build/html
fi
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: '_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2