Fix deploys

This commit is contained in:
Paulus Schoutsen 2015-12-19 22:06:21 -08:00
parent a142baf14f
commit 7519b4f0e0
2 changed files with 5 additions and 5 deletions

View File

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

View File

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