Skip to content

Instantly share code, notes, and snippets.

@oxlade39
Created April 20, 2012 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxlade39/2431288 to your computer and use it in GitHub Desktop.
Save oxlade39/2431288 to your computer and use it in GitHub Desktop.
automated jekyll deployment with plugins
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