-
Notifications
You must be signed in to change notification settings - Fork 7
65 lines (55 loc) · 1.66 KB
/
doc-build.yml
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
name: Build and Deploy Sphinx Docs
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[doc, jax, test]"
# Step 4: Build Sphinx documentation
- name: Build Sphinx documentation
working-directory: doc
run: |
python -m sphinx -b html . _build/html
# Step 5: Upload Sphinx docs as an artifact
- name: Upload Sphinx docs artifact
uses: actions/upload-artifact@v4
with:
name: sphinx-docs
path: doc/_build/html
deploy:
# Avoid running this job on a fork
if: github.repository == 'parietal-INRIA/fmralign' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
# Step 6: Download Sphinx docs artifact
- name: Download Sphinx docs artifact
uses: actions/download-artifact@v4
with:
name: sphinx-docs
path: doc/_build/html/
# Step 7: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html