Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Rake tasks to deploy jekyll build with rsync
desc "Build jekyll locally"
task :build do
sh "bundle exec jekyll build"
desc "Deploy _site"
task :deploy => :build do
user = 'user'
host = ''
release_dir ='%Y%m%d%H%M%S')
releases_path = "/var/www/{release_dir}/"
current_symlink = '/var/www/'
sh "rsync -avz --delete _site/ #{user}@#{host}:#{releases_path}"
sh "ssh #{user}@#{host} 'ln -sfn #{releases_path} #{current_symlink}'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment