diff --git a/.travis.yml b/.travis.yml index 1fb07847bb1..638b0c53704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ sudo: false cache: bundler script: rake generate after_success: -- git config user.name "Travis CI" -- git config user.email "balloob+bot@gmail.com" - '[ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ] && rake deploy || false' env: global: diff --git a/Rakefile b/Rakefile index c9afe27ff13..e9b0c6a3933 100644 --- a/Rakefile +++ b/Rakefile @@ -267,12 +267,14 @@ multitask :push do puts "\n## Pushing generated #{deploy_dir} website" if ENV["GH_TOKEN"].nil? - # Bundler.with_clean_env { system "git push origin #{deploy_branch}" } + Bundler.with_clean_env { system "git push origin #{deploy_branch}" } else puts "## Using GH_TOKEN" new_origin = `git remote -v | grep origin | grep push | awk '{print $2}'`.chomp.sub('//', "//#{ENV['GH_TOKEN']}@") - Bundler.with_clean_env { system "git remote add origin-auth #{new_origin} > /dev/null 2>&1" } - Bundler.with_clean_env { system "git push --quiet origin-auth #{deploy_branch} > /dev/null 2>&1" } + system 'git config user.name "Travis CI"' + system 'git config user.email "balloob+bot@gmail.com"' + system "git remote add origin-auth #{new_origin} > /dev/null 2>&1" + system "git push --quiet origin-auth #{deploy_branch} > /dev/null 2>&1" end puts "\n## Github Pages deploy complete"