Skip to content

Commit a76b3eb

Browse files
oestebaneffigies
andcommitted
enh: including comments from code review
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent f5b29ba commit a76b3eb

File tree

2 files changed

+35
-28
lines changed

2 files changed

+35
-28
lines changed

.github/workflows/docs-build-pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ on:
77

88
jobs:
99
build:
10-
if: "github.repository_owner != 'nipreps' && !contains(github.event.head_commit.message, '[skip ci]')"
10+
if: "(github.repository_owner != 'nipreps') && !contains(github.event.head_commit.message, '[skip ci]')"
1111
runs-on: ubuntu-latest
1212

1313
steps:
1414
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
1517

1618
- name: Determine current branch/tag name
1719
run: |
@@ -33,7 +35,7 @@ jobs:
3335
- name: Install GraphViz
3436
run: |
3537
sudo apt-get update -y
36-
sudo apt-get install -y graphviz
38+
sudo apt-get install -y --no-install-recommends graphviz
3739
3840
- name: Install dependencies
3941
run: |

.github/workflows/docs-build-update.yml

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
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: |
@@ -32,7 +35,7 @@ jobs:
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

Comments
 (0)