Auto-deploy commits to master
This commit is contained in:
parent
721bbb6918
commit
a142baf14f
3 changed files with 18 additions and 3 deletions
11
Rakefile
11
Rakefile
|
@ -264,8 +264,17 @@ multitask :push do
|
|||
message = "Site updated at #{Time.now.utc}"
|
||||
puts "\n## Committing: #{message}"
|
||||
system "git commit -m \"#{message}\""
|
||||
|
||||
puts "\n## Pushing generated #{deploy_dir} website"
|
||||
Bundler.with_clean_env { system "git push origin #{deploy_branch}" }
|
||||
if ENV["GH_TOKEN"].nil?
|
||||
# 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" }
|
||||
end
|
||||
|
||||
puts "\n## Github Pages deploy complete"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue