Travis update

This commit is contained in:
Angelos Chalaris
2017-12-30 15:17:19 +02:00
parent eb8c26858f
commit 5d888ebba6

View File

@ -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