-
Notifications
You must be signed in to change notification settings - Fork 12
64 lines (59 loc) · 2.12 KB
/
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
name: Docs
on: [push, pull_request]
jobs:
docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
set -x
set -e
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda update -q conda
conda info -a
conda create -n test-environment python=${{ matrix.python-version }} --file docs/requirements.txt
conda init
- name: Build Docs
run: |
# Copied from .bashrc. We can't just source .bashrc because it exits
# when the shell isn't interactive.
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/share/miniconda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/share/miniconda/etc/profile.d/conda.sh" ]; then
. "/usr/share/miniconda/etc/profile.d/conda.sh"
else
export PATH="/usr/share/miniconda/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
set -x
set -e
conda activate test-environment
cd docs
make html
# Note, the gh-pages deployment requires setting up a SSH deploy key.
# See
# https://github.com/JamesIves/github-pages-deploy-action/tree/dev#using-an-ssh-deploy-key-
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
folder: docs/_build/html
ssh-key: ${{ secrets.DEPLOY_KEY }}
clean-exclude: benchmarks/