Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple Capistrano recipe for Jekyll
set :application, 'foo'
set :repository, '_site'
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :gzip
set :use_sudo, false
set :host, ''
role :web, host
role :app, host
role :db, host, :primary => true
ssh_options[:port] = 30123
set :user, 'username'
set :group, user
set(:dest) { Capistrano::CLI.ui.ask("Destination: ") }
if dest == 'dev'
set :deploy_to, "/home/#{user}/sites/dev.#{application}.com"
elsif dest == 'www'
set :deploy_to, "/home/#{user}/sites/#{application}.com"
before 'deploy:update', 'deploy:update_jekyll'
namespace :deploy do
[:start, :stop, :restart, :finalize_update].each do |t|
desc "#{t} task is a no-op with jekyll"
task t, :roles => :app do ; end
desc 'Run jekyll to update site before uploading'
task :update_jekyll do
%x(rm -rf _site/* && jekyll)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.