forked from neuronsimulator/nrn
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (71 loc) · 2.82 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: NEURON Documentation
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**
env:
DEFAULT_PY_VERSION: '3.11'
jobs:
documentation:
runs-on: ubuntu-20.04
name: Documentation
timeout-minutes: 20
steps:
- name: Install apt packages
run: |
sudo apt-get update --fix-missing
sudo apt-get install build-essential libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin
sudo apt-get install ffmpeg doxygen pandoc
shell: bash
- name: Set up Python@${{ env.DEFAULT_PY_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PY_VERSION }}
- uses: actions/checkout@v3
- name: Install Python dependencies
working-directory: ${{runner.workspace}}/nrn
run: |
python -m pip install --upgrade pip -r nrn_requirements.txt
- name: Install Python documentation dependencies
working-directory: ${{runner.workspace}}/nrn
run: |
python -m pip install --upgrade -r docs/docs_requirements.txt
- name: Documentation
id: documentation
shell: bash
working-directory: ${{runner.workspace}}/nrn
run: |
echo "-------- NEURON wheel --------";
python setup.py build_ext bdist_wheel;
neuron_wheel=dist/NEURON*.whl;
echo "-------- install wheel --------"
python -m pip install $neuron_wheel;
echo "-------- now build docs--------";
python setup.py docs;
echo "-------- disable jekyll--------";
pushd docs/_build;
touch .nojekyll;
echo "-------- OK to deploy! --------";
echo "OK_TO_DEPLOY_DOCS=true" >> $GITHUB_ENV
# This step will set up an SSH connection on tmate.io for live debugging.
# To enable it, you have to:
# * add 'live-debug-docs' to your PR title
# * push something to your PR branch (note that just re-running the pipeline disregards the title update)
- name: live debug session on failure (manual steps required, check `.github/docs.yml`)
if: failure() && contains(github.event.pull_request.title, 'live-debug-docs')
uses: mxschmitt/action-tmate@v3
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: env.OK_TO_DEPLOY_DOCS == 'true' && github.ref == 'refs/heads/master'
with:
branch: gh-pages # The branch the action should deploy to.
folder: ${{runner.workspace}}/nrn/docs/_build # The folder the action should deploy.
single-commit: true #have a single commit on the deployment branch instead of maintaining the full history