Browse Source

updated rakefile to support github user pages, and github project pages for deployment

unreleased_contents
B Mathis 15 years ago
parent
commit
399fe77f67
  1. 27
      Rakefile

27
Rakefile

@ -1,22 +1,21 @@
require 'active_support' require 'active_support'
## -- CHANGE FOR YOUR PROJECT -- ## site_url = "http://yoursite.com" # deployed site url for sitemap.xml generator
site_url = "http://yoursite.com" # deployed site url
ssh_user = "user@host.com" # for rsync deployment
document_root = "~/document_root/" # for rsync deployment
## ---- ##
port = "4000" # preview project port eg. http://localhost:4000 port = "4000" # preview project port eg. http://localhost:4000
site = "site" # compiled site directory site = "site" # compiled site directory
source = "source" # source file directory source = "source" # source file directory
# Github pages deploy config ## -- Rsync Deploy config -- ##
# For github user pages, use "master" ssh_user = "user@host.com" # for rsync deployment
# For github project pages use "gh-pages" document_root = "~/document_root/" # for rsync deployment
# If you're not using this, you can remove it ## ---- ##
# Read http://pages.github.com for guidance
github_pages_branch = "gh-pages" ## -- Github Pages deploy config -- ##
# Read http://pages.github.com for guidance
# If you're not using this, you can remove it
source_branch = "source" # this compiles to your deploy branch
deploy_branch = "gh-pages" # For user pages, use "master" for project pages use "gh-pages"
## ---- ##
def ok_failed(condition) def ok_failed(condition)
if (condition) if (condition)
@ -93,7 +92,7 @@ task :watch do
end end
end end
desc "generate and deploy website" desc "generate and deploy website via rsync"
multitask :deploy_rsync => [:default, :clean_debug] do multitask :deploy_rsync => [:default, :clean_debug] do
print ">>> Deploying website <<<" print ">>> Deploying website <<<"
ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}") ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}")
@ -112,7 +111,7 @@ multitask :github_user_deploy => [:default, :clean_debug] do
message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}" message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
repo.commit(message) repo.commit(message)
repo.push repo.push
repo.branch("source").checkout repo.branch("#{source_branch}").checkout
end end
desc "start up an instance of serve on the output files" desc "start up an instance of serve on the output files"

Loading…
Cancel
Save