Skip to content

Commit c21a95e

Browse files
committed
build: update docs after merge to master
1 parent fba037f commit c21a95e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ after_success:
1111
- tox -e cover
1212
- tox -e lint
1313
- coveralls
14+
- scripts/merge.sh

scripts/merge.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Copyright 2014 Google Inc. All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -ev
18+
19+
# if merging to master and not a pull request, update docs
20+
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
21+
# generate new set of json files in docs/json/master
22+
tox -e docs
23+
git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} ghpages
24+
cp -R docs/_build/html/* ghpages/
25+
cd ghpages
26+
git add .
27+
# commit to gh-pages branch to apply changes
28+
git config user.name "selfiebot"
29+
git commit -m "Update docs after merge to master"
30+
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages
31+
fi

0 commit comments

Comments
 (0)