-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (96 loc) · 2.66 KB
/
docs.yml
File metadata and controls
114 lines (96 loc) · 2.66 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
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
build-docs:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Free up disk space
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
echo "Disk space after cleanup:"
df -h
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgl1 \
libglib2.0-0 \
libgomp1 \
libsm6 \
libxrender1 \
libxext6 \
libxrandr2 \
libxi6
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv pip install --system torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install --system -e ".[docs]"
- name: Clear pip cache
run: |
pip cache purge || true
- name: Build documentation
run: |
cd docs
make html
- name: Check for warnings
run: |
cd docs
make html SPHINXOPTS="--keep-going"
continue-on-error: true
- name: Disable Jekyll processing
run: touch docs/_build/html/.nojekyll
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/_build/html/
retention-days: 7
deploy:
needs: build-docs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download documentation artifacts
uses: actions/download-artifact@v4
with:
name: documentation
path: ./docs-html
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact for Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./docs-html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4