-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (90 loc) · 2.34 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
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
name: "Build Docs"
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "tests/**"
- "third_party/**"
- "*.md"
branches:
- main
push:
paths-ignore:
- "tests/**"
- "third_party/**"
- "*.md"
branches:
- main
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "${{ matrix.python-version }}"
- name: Install conda-build
run: conda install conda-build
- name: Build package
run: |
mkdir ~/package
conda build ./packaging/conda --python=${{ matrix.python-version }} --output-folder ~/package
- name: Build docs
run: |
set -x
sudo apt update && sudo apt install -yqq doxygen
conda install -c file://${HOME}/package/ spdl
conda install -c conda-forge 'ffmpeg==6'
pip install -r docs/requirements.txt
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
./docs/build.sh
mkdir upload
mv docs/_build upload/_site
- uses: actions/upload-artifact@v4
with:
name: docs
path: upload
if-no-files-found: error
retention-days: 7
overwrite: true
deploy:
permissions:
# Required for `git push`
# Note:
# This is not effective from fork.
# When you debug this, make sure to make a branch on the upstream, and
# make PR from there.
contents: write
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
fetch-depth: 5
- uses: actions/download-artifact@v4
with:
name: docs
- name: Update main doc
run: |
set -x
ls -alh
rm -rf main
mv _site main
git add --all main || true
git config user.name "ci"
git config user.email "[email protected]"
git commit --amend -m "Update docs" || true
git push -f