Files
30-seconds-of-code/.travis/push.sh
Angelos Chalaris 5d888ebba6 Travis update
2017-12-30 15:17:19 +02:00

29 lines
775 B
Bash
Executable File

setup_git() {
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
}
commit_website_files() {
if [[ $(( $TRAVIS_EVENT_TYPE )) != 'pull_request' ]]; then
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() {
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
commit_website_files
upload_files