Skip to content

Commit

Permalink
updated rakefile to support github user pages, and github project pag…
Browse files Browse the repository at this point in the history
…es for deployment
  • Loading branch information
imathis committed Nov 24, 2009
1 parent 54766a0 commit 399fe77
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions Rakefile
@@ -1,22 +1,21 @@
require 'active_support'

## -- CHANGE FOR YOUR PROJECT -- ##
site_url = "http://yoursite.com" # deployed site url
site_url = "http://yoursite.com" # deployed site url for sitemap.xml generator
port = "4000" # preview project port eg. http://localhost:4000
site = "site" # compiled site directory
source = "source" # source file directory

## -- Rsync Deploy config -- ##
ssh_user = "user@host.com" # for rsync deployment
document_root = "~/document_root/" # for rsync deployment
## ---- ##

port = "4000" # preview project port eg. http://localhost:4000
site = "site" # compiled site directory
source = "source" # source file directory

# Github pages deploy config
# For github user pages, use "master"
# For github project pages use "gh-pages"
# If you're not using this, you can remove it
## -- Github Pages deploy config -- ##
# Read http://pages.github.com for guidance

github_pages_branch = "gh-pages"
# 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)
if (condition)
Expand Down Expand Up @@ -93,7 +92,7 @@ task :watch do
end
end

desc "generate and deploy website"
desc "generate and deploy website via rsync"
multitask :deploy_rsync => [:default, :clean_debug] do
print ">>> Deploying website <<<"
ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}")
Expand All @@ -112,7 +111,7 @@ multitask :github_user_deploy => [:default, :clean_debug] do
message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
repo.commit(message)
repo.push
repo.branch("source").checkout
repo.branch("#{source_branch}").checkout
end

desc "start up an instance of serve on the output files"
Expand Down

0 comments on commit 399fe77

Please sign in to comment.