Skip to content

Commit 71e7d34

Browse files
authored
Merge pull request #924 from SpiNNakerManchester/publish-action
Define a publish action
2 parents 3fdcaf9 + f615184 commit 71e7d34

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright (c) 2020 The University of Manchester
2+
#
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 3 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
name: Publish
17+
18+
on:
19+
push:
20+
branches: [ master ]
21+
22+
env:
23+
ROOT_DOC_DIR: doc/global
24+
C_DOC_DIR: neural_modelling/html
25+
PY_DOC_DIR: doc/source/_build/html
26+
DEPLOY_DIR: deploy
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Set up Python 3.6
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: 3.6
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
- name: Checkout SupportScripts
39+
uses: actions/checkout@v2
40+
with:
41+
repository: SpiNNakerManchester/SupportScripts
42+
path: support
43+
- name: Set dynamic environment variables
44+
# This step can not be merged with Checkout Spinnaker Dependencies
45+
run: |
46+
echo "SPINN_DIRS=$PWD/spinnaker_tools" >> $GITHUB_ENV
47+
echo "GITHUB_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
48+
- name: Checkout SpiNNaker Dependencies
49+
run: |
50+
support/gitclone2.sh https://github.com/SpiNNakerManchester/spinnaker_tools.git
51+
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNUtils.git
52+
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNMachine.git
53+
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNMan.git
54+
support/gitclone2.sh https://github.com/SpiNNakerManchester/PACMAN.git
55+
support/gitclone2.sh https://github.com/SpiNNakerManchester/DataSpecification.git
56+
support/gitclone2.sh https://github.com/SpiNNakerManchester/spalloc.git
57+
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNFrontEndCommon.git
58+
- name: Read tags
59+
run: make doxysetup
60+
working-directory: neural_modelling
61+
- name: Install Python dependencies
62+
run: |
63+
python -m pip install --upgrade pip
64+
(cd SpiNNUtils && exec python setup.py install || exit 1)
65+
(cd SpiNNMachine && exec python setup.py install || exit 1)
66+
(cd SpiNNMan && exec python setup.py install || exit 1)
67+
(cd PACMAN && exec python setup.py install || exit 1)
68+
(cd DataSpecification && exec python setup.py install || exit 1)
69+
(cd spalloc && exec python setup.py install || exit 1)
70+
(cd SpiNNFrontEndCommon && exec python setup.py install || exit 1)
71+
pip install -r requirements-test.txt
72+
73+
- name: Build Python Documentation
74+
run: support/travis-sphinx.sh html -T -E -b html -d _build/doctrees-readthedocsdirhtml -D language=en . _build/html
75+
76+
- name: Build C documentation
77+
uses: mattnotmitt/doxygen-action@v1.1.0
78+
with:
79+
working-directory: neural_modelling
80+
81+
- name: Merge documentation trees
82+
run: |
83+
cp -vaT $ROOT_DOC_DIR $DEPLOY_DIR
84+
cp -vaT $C_DOC_DIR $DEPLOY_DIR/c
85+
cp -vaT $PY_DOC_DIR $DEPLOY_DIR/python
86+
87+
- name: Deploy to GitHub Pages
88+
uses: JamesIves/github-pages-deploy-action@3.7.1
89+
with:
90+
github_token: ${{ secrets.GITHUB_TOKEN }}
91+
branch: gh-pages
92+
folder: ${{ env.DEPLOY_DIR }}

0 commit comments

Comments
 (0)