Created
April 20, 2012 19:45
-
-
Save oxlade39/2431288 to your computer and use it in GitHub Desktop.
automated jekyll deployment with plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Delete generated _site files' | |
task :clean do | |
system "rm -fR _site2" | |
system "git submodule update" | |
system "cd _site && git checkout master . && git clean -d -f" | |
end | |
desc 'Run the jekyll dev server' | |
task :server do | |
system "jekyll --server" | |
end | |
desc 'Clean temporary files and run the server' | |
task :compile => :clean do | |
system "jekyll" | |
end | |
desc 'generate the jekyll site and then copy to staging area' | |
task :generate => :compile do | |
system "cp -R _site2/* _site/" | |
system "rm -R _site2" | |
end | |
desc 'commit and push to github' | |
task :deploy, [:commit_message] => :generate do |t, args| | |
if args.commit_message | |
puts "Committing and pushing with commit message: #{args.commit_message}" | |
system "cd _site && git add . && git commit -m \"#{args.commit_message}\" && git push" | |
system "git add _site" | |
system "git co -m \"updating submodule reference to master\"" | |
else | |
puts "Missing commit_message" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment