Skip to content

Commit

Permalink
Update deploy process
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Jan 2, 2012
1 parent c1cc24c commit fa94733
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ gem "haml", "~>3.0.0"
gem "compass", "~>0.10.0"
gem "ultraviolet", :git => "git://github.com/wycats/ultraviolet.git"
gem "ronn"
gem "highline"
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ GEM
compass (0.10.6)
haml (>= 3.0.4)
haml (3.0.24)
highline (1.6.8)
hpricot (0.8.3)
mustache (0.11.2)
rack (1.2.1)
Expand All @@ -38,6 +39,7 @@ PLATFORMS
DEPENDENCIES
compass (~> 0.10.0)
haml (~> 3.0.0)
highline
ronn
staticmatic (~> 0.11.0.alpha)!
ultraviolet!
28 changes: 26 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,31 @@ task :man do
# @TODO
end

task :release => [:build, :man] do
Dir.chdir("site") { Bundler.with_clean_env { system ENV["CMD"] } }
desc "Deploy the website to github pages"
task :deploy do |t, args|
require "highline/import"
message = ask("Provide a deployment message: ") do |q|
q.validate = /\w/
q.responses[:not_valid] = "Can't be empty."
end

system "staticmatic build ."

Dir.chdir "site" do
File.open("CNAME", "w") do |file|
file.puts "handlebarsjs.com"
end

unless File.exist?(".git")
system "git init"
system "git remote add github git@github.com:wycats/handlebars-site.git"
end

system "git fetch github"
system "git add -A"
system "git commit -m '#{message.gsub("'", "\\'")}'"
system "git rebase github/gh-pages"
system "git push github master:gh-pages"
end
end

0 comments on commit fa94733

Please sign in to comment.