-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (85 loc) · 3.08 KB
/
docs.yml
File metadata and controls
100 lines (85 loc) · 3.08 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
name: Deploy Documentation
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
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@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-docs-v2-${{ hashFiles('docs/requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-docs-v2-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
# Install package first without documentation dependencies
pip install -e . --no-deps
# Install core dependencies
pip install "pynwb>=2.8.2" "hdmf>=3.14.1" "hedtools>=0.7.1"
# Install documentation dependencies (this will override any conflicting versions)
pip install --force-reinstall -r docs/requirements.txt
- name: Verify sphinx extensions
run: |
python -c "import sphinx_design; print(f'sphinx_design version: {sphinx_design.__version__}')"
python -c "import sphinx_book_theme; print(f'sphinx_book_theme version: {sphinx_book_theme.__version__}')"
python -c "import sphinx; print(f'sphinx version: {sphinx.__version__}')"
- name: Install missing extensions (fallback)
if: failure()
run: |
echo "Installing fallback dependencies..."
pip install --force-reinstall "sphinx>=8.1.3" "sphinx-design>=0.6.1" "sphinx-book-theme>=1.1.3" "sphinx-copybutton>=0.5.2" "myst-parser>=4.0.0"
- name: Build documentation
run: |
cd docs
make html
env:
SPHINXOPTS: "--keep-going"
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./docs/build/html
#------------------------------------------------
# Deploy Job: Deploys the built site
#------------------------------------------------
deploy:
# This job depends on the 'build' job completing successfully
needs: build
# Only deploy when pushing to main branch, not on pull requests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
# Specify the deployment environment
environment:
name: github-pages
# The URL will be automatically set by the deployment step's output
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
# This is the official action for deploying the artifact to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4