Skip to content

Commit ce707fb

Browse files
committed
Merge pull request #793 from Turbo87/travis-deploy
TravisCI: Automatically update "nodegit.github.com" repository
2 parents abd75e5 + 2d6cd49 commit ce707fb

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎.travis.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ after_success:
8080
node-pre-gyp publish
8181
fi
8282

83+
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "4.1" ]; then
84+
.travis/deploy-docs.sh;
85+
fi
86+
8387
notifications:
8488
slack:
8589
secure: KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc=

‎.travis/deploy-docs.sh‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
4+
# delete "nodegit.github.com" folder if it exists
5+
rm -rf "nodegit.github.com" || exit 0;
6+
7+
# clone "nodegit.github.com" repository
8+
git clone "https://github.com/nodegit/nodegit.github.com.git"
9+
10+
# change into "nodegit.github.com" folder
11+
cd "nodegit.github.com"
12+
13+
# install node dependencies
14+
npm install
15+
16+
# link "nodegit" folder
17+
ln -s ../.. generate/nodegit
18+
19+
# generate new docs
20+
node generate
21+
22+
# configure git user information
23+
git config user.name "Travis CI"
24+
git config user.email "noreply@travis-ci.org"
25+
26+
# commit changes
27+
git add .
28+
git commit -m "Deploy to GitHub Pages
29+
30+
see https://github.com/nodegit/nodegit.github.com/commit/${TRAVIS_COMMIT}"
31+
git tag "${TRAVIS_COMMIT}"
32+
33+
# push to the "nodegit.github.com" repository
34+
git push --quiet "https://${GH_TOKEN}@github.com/nodegit/nodegit.github.com.git" master "${TRAVIS_COMMIT}" > /dev/null 2>&1

0 commit comments

Comments
 (0)