-
Notifications
You must be signed in to change notification settings - Fork 18
48 lines (44 loc) · 1.45 KB
/
build_doc.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
name: Build documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r doc/requirements_doc.txt
python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
- name: Install package
run: |
python -m pip install -e .
- name: Make doc
run: |
cd doc
python minify.py
make html
cd ..
- name: Push docs
run: |
# See https://github.community/t/github-actions-bot-email-address/17204/5
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git fetch origin gh-pages
git checkout gh-pages
git rm -r dev/*
cp -r doc/_build/html/* dev
git add dev
# If the doc is up to date, the script shouldn't fail, hence --allow-empty
# Might be a cleaner way to check
git commit --allow-empty -m "Deployed to GitHub Pages"
git push --force origin gh-pages