1212
1313 steps :
1414 - uses : actions/checkout@v2
15+ with :
16+ ssh-key : " ${{ secrets.NIPREPS_DEPLOY }}"
17+ fetch-depth : 0
1518
1619 - name : Determine current branch/tag name
1720 run : |
3235 - name : Install GraphViz
3336 run : |
3437 sudo apt-get update -y
35- sudo apt-get install -y graphviz
38+ sudo apt-get install -y --no-install-recommends graphviz
3639
3740 - name : Install dependencies
3841 run : |
@@ -42,35 +45,37 @@ jobs:
4245 run : |
4346 make -C docs/ SPHINXOPTS="-W" BUILDDIR="$HOME/docs" CURBRANCH="${CURBRANCH:-html}" html
4447
48+ - name : Checkout gh-pages
49+ if : " !startsWith(github.ref, 'refs/tags/') || (github.event.pull_request.merged == true)"
50+ run : |
51+ git fetch
52+ git checkout -b gh-pages origin/gh-pages
53+
4554 - name : Push created tag to gh-pages
4655 if : startsWith(github.ref, 'refs/tags/')
4756 run : |
48- MAJOR_MINOR=${CURBRANCH%.*}
49- if [[ "${MAJOR_MINOR}" == "" ]]; then
50- echo "Could not identify release series"
51- exit 1
52- fi
53- git checkout -b gh-pages origin/gh-pages
54- git pull
55- git rm -r ${MAJOR_MINOR}/
56- # It is fundamental that the directory does not exist at all.
57- rm -rf ${MAJOR_MINOR}
58- cp -r $HOME/docs/$CURBRANCH $PWD/${MAJOR_MINOR}
59- git commit -am "rel(${CURBRANCH}): Update docs of ${MAJOR_MINOR} series" || true
60- git push
57+ MAJOR_MINOR=${CURBRANCH%.*}
58+ if [[ "${MAJOR_MINOR}" == "" ]]; then
59+ echo "Could not identify release series"
60+ exit 1
61+ fi
62+ git rm -r ${MAJOR_MINOR}/
63+ # It is fundamental that the directory does not exist at all.
64+ rm -rf ${MAJOR_MINOR}
65+ cp -r $HOME/docs/$CURBRANCH $PWD/${MAJOR_MINOR}
66+ git commit -am "rel(${CURBRANCH}): Update docs of ${MAJOR_MINOR} series" || true
67+ git push
6168
6269 - name : Push "master" docs to gh-pages after a PR is merged
6370 if : github.event.pull_request.merged == true
6471 run : |
65- if [[ "${CURBRANCH}" != "master" ]]; then
66- echo "$CURBRANCH is not the default development branch"
67- exit 1
68- fi
69- git checkout -b gh-pages origin/gh-pages
70- git pull
71- git rm -r master/
72- # It is fundamental that the directory does not exist at all.
73- rm -rf master
74- cp -r $HOME/docs/$CURBRANCH $PWD/master
75- git commit -am "docs(master): Update docs of development line" || true
76- git push
72+ if [[ "${CURBRANCH}" != "master" ]]; then
73+ echo "$CURBRANCH is not the default development branch"
74+ exit 1
75+ fi
76+ git rm -r master/
77+ # It is fundamental that the directory does not exist at all.
78+ rm -rf master
79+ cp -r $HOME/docs/$CURBRANCH $PWD/master
80+ git commit -am "docs(master): Update docs of development line" || true
81+ git push
0 commit comments