-
Notifications
You must be signed in to change notification settings - Fork 20
58 lines (50 loc) · 1.51 KB
/
build-docs.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
name: Docs
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "00 12 * * 0" # Every Sunday noon (preserve the cache folders)
workflow_dispatch:
env:
PYTHON_VERSION: "3.10"
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Full Python version
run: |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")"
- name: Cache folder for TorchUncertainty
uses: actions/cache@v4
id: cache-folder
with:
path: |
~/.cache/torch-uncertainty/
key: torch-uncertainty-${{ runner.os }}
- name: Install dependencies
run: |
python3 -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
python3 -m pip install .[all]
- name: Sphinx build
if: github.event.pull_request.draft == false
run: |
cd docs && make clean && make html
- name: Deploy on GitHub pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name != 'pull_request' }}
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: torch-uncertainty/torch-uncertainty.github.io
publish_branch: main
publish_dir: docs/build/html