-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (76 loc) · 2.26 KB
/
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
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
name: Doc
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
unix:
runs-on: macos-11
name: Doc (Python ${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
steps:
- name: "Check out"
uses: actions/checkout@v3
- name: "Install SDK on MacOS"
run: source devtools/scripts/install_macos_sdk.sh
- name: "Update the conda enviroment file"
uses: cschleiden/replace-tokens@v1
with:
tokenPrefix: '@'
tokenSuffix: '@'
files: devtools/conda-envs/build-macos-11.yml
- uses: conda-incubator/setup-miniconda@v2
name: "Install dependencies with conda"
with:
activate-environment: build
environment-file: devtools/conda-envs/build-doc.yml
python-version: ${{ matrix.python-version }}
- name: "List conda packages"
shell: bash -l {0}
run: conda list
- name: "Configure"
shell: bash -l {0}
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DPLUGIN_BUILD_CUDA_LIB=OFF
- name: "Build"
shell: bash -l {0}
run: |
cd build
make -j2 install
make -j2 PythonInstall
- name: Build Documentation
shell: bash -l {0}
run: |
sphinx-build ./docs ./html
- name: Deploy documentation
shell: bash -l {0}
run: |
git reset --hard HEAD
set -x
echo "::group::Push page to gh-pages branch"
git config user.name "$(git show --format=%an -s)"
git config user.email "$(git show --format=%ae -s)"
git fetch origin
git switch gh-pages
rsync -va --delete-excluded html/ docs/
touch docs/.nojekyll
git add -f docs/*
git add -f docs/.nojekyll
git commit -m "Docs from $GITHUB_REF $GITHUB_SHA" || echo "Branch is up to date"
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
echo "Deployment is deactivated on pull requests"
else
git push -f origin gh-pages
fi
echo "::endgroup::"