Skip to content

Commit 28c528c

Browse files
committed
ci: Publish devel docs on every push to master
1 parent 34b62a5 commit 28c528c

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

.ci/travis-publish-docs.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ SOURCE_BRANCH="master"
88
TARGET_BRANCH="gh-pages"
99
DOC_BUILD_DIR="_build/html/"
1010

11-
if [ "${TRAVIS_PULL_REQUEST}" != "false" -o -z "${TRAVIS_TAG}" ]; then
11+
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
1212
echo "Skipping documentation deploy."
1313
exit 0
1414
fi
1515

16-
pip install -r docs/requirements.txt
17-
make htmldocs
18-
1916
git config --global user.email "infra@magic.io"
2017
git config --global user.name "Travis CI"
2118

@@ -29,14 +26,15 @@ cd docs/gh-pages
2926
git checkout "${TARGET_BRANCH}" || git checkout --orphan "${TARGET_BRANCH}"
3027
cd ..
3128

32-
rm -r gh-pages/devel/
33-
rsync -a "${DOC_BUILD_DIR}/" gh-pages/devel/
34-
35-
if [ -n "${TRAVIS_TAG}" ]; then
36-
rm -r gh-pages/current/
37-
rsync -a "${DOC_BUILD_DIR}/" gh-pages/current/
29+
if [ -z "${TRAVIS_TAG}" ]; then
30+
VERSION="devel"
31+
else
32+
VERSION="current"
3833
fi
3934

35+
rm -r "gh-pages/${VERSION}/"
36+
rsync -a "${DOC_BUILD_DIR}/" "gh-pages/${VERSION}/"
37+
4038
cd gh-pages
4139

4240
if git diff --quiet --exit-code; then

.ci/travis-release.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
set -e -x
44

5-
65
if [ -z "${TRAVIS_TAG}" ]; then
76
# Not a release
87
exit 0
@@ -51,5 +50,3 @@ for distfile in "${expected_wheels[@]}"; do
5150
done
5251

5352
python -m twine upload dist/*.whl dist/*.tar.*
54-
55-
.ci/travis-publish-docs.sh

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,14 @@ script:
152152
- .ci/travis-build-wheels.sh
153153

154154
deploy:
155-
provider: script
156-
script: .ci/travis-release.sh
157-
on:
158-
tags: true
159-
condition: '"${BUILD}" == *release*'
155+
- provider: script
156+
script: .ci/travis-release.sh
157+
on:
158+
tags: true
159+
condition: '"${BUILD}" == *release*'
160+
161+
- provider: script
162+
script: .ci/travis-publish-docs.sh
163+
on:
164+
branch: master
165+
condition: '"${BUILD}" == *docs*'

0 commit comments

Comments
 (0)