From 5d888ebba665cf648abbf5340cc1fb26ab5bbb85 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 30 Dec 2017 15:17:19 +0200 Subject: [PATCH] Travis update --- .travis/push.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis/push.sh b/.travis/push.sh index 17ee111d6..e9fe39ab3 100755 --- a/.travis/push.sh +++ b/.travis/push.sh @@ -5,16 +5,22 @@ setup_git() { commit_website_files() { if [[ $(( $TRAVIS_EVENT_TYPE )) != 'pull_request' ]]; then - if [[ $(( $TRAVIS_BRANCH )) != 'master' ]]; then - git checkout master - git add * - git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" - fi + if [[ $(( $TRAVIS_BRANCH )) == 'master' ]]; then + echo "Commiting to master branch..." + git checkout master + git add * + git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" + fi fi } upload_files() { - git push --force --quiet "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" master > /dev/null 2>&1 + if [[ $(( $TRAVIS_EVENT_TYPE )) != 'pull_request' ]]; then + if [[ $(( $TRAVIS_BRANCH )) == 'master' ]]; then + echo "Pushing to master branch..." + git push --force --quiet "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" master > /dev/null 2>&1 + fi + fi } setup_git