travis: only deploy master

This commit is contained in:
Carl Pearson
2017-12-17 17:30:56 -06:00
parent 9b8c8a8080
commit 9478882bd5

View File

@@ -9,13 +9,13 @@ script:
- hugo
after_success: |
if [ -n "$GITHUB_TOKEN" ]; then
if [ -n "$GITHUB_TOKEN" ] && [ "$TRAVIS_BRANCH" -eq "master" ]; then
cd "$TRAVIS_BUILD_DIR"
cd public
git init
git checkout -b master
git add .
git -c user.name='cwpearson' -c user.email='carl.w.pearson@gmail.com' commit -m "push from hugo-cwpearson $TRAVIS_BRANCH $TRAVIS_COMMIT"
git -c user.name='cwpearson' -c user.email='carl.w.pearson@gmail.com' commit -m "push from hugo-cwpearson $TRAVIS_COMMIT"
# Make sure to make the output quiet, or else the API token will leak!
# This works because the API key can replace your password.
git push -f -q https://cwpearson:$GITHUB_TOKEN@github.com/cwpearson/cwpearson.github.io master 2> /dev/null