Skip to content

Instantly share code, notes, and snippets.

@olivierlacan
Created June 7, 2013 05:47
Show Gist options
  • Save olivierlacan/5727278 to your computer and use it in GitHub Desktop.
Save olivierlacan/5727278 to your computer and use it in GitHub Desktop.
The hacky little Thor script I use to deploy my Jekyll site to GitHub Pages since it uses "unsafe plugins".
class Deploy < Thor
include Thor::Actions
desc "github", "deploy to GitHub Pages"
def github
original_path = Dir.pwd
deploy_path = "/Users/olivierlacan/Development/perso/olivierlacan.github.com"
puts "Running Jekyll build --destination #{deploy_path}"
run "jekyll build --destination #{deploy_path}"
puts "Committing all changes"
run "cd #{deploy_path} && git add -A . && git commit -m 'Run jekyll build at #{Time.now}'"
puts "Deploying to GitHub"
run "cd #{deploy_path} && git push origin master"
puts "Donezies!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment