April 27, 2014
jekyll is an excellent tool for creating static pages and blogs. Our BigBinary blog is based on jekyll. Deploying our blog to heroku took longer than I had expected. I am outlining what I did to deploy BigBinary blog to heroku.
Open _config.yml
and add following line at the very bottom.
exclude: ['vendor']
Create a new file called Procfile
at the root of the project with following
content.
web: bundle exec jekyll build && bundle exec thin start -p\$PORT -V
console: echo console
rake: echo rake
Add Gemfile
at the root of the project.
source 'https://rubygems.org'
gem 'jekyll', '2.4.0'
gem 'rake'
gem 'foreman'
gem 'thin'
gem 'rack-contrib'
Add config.ru
at the root of the project with following content.
require 'rack/contrib/try_static'
use Rack::TryStatic,
:root => "\_site",
:urls => %w[/],
:try => ['.html', 'index.html', '/index.html']
run lambda { |env|
return [404, {'Content-Type' => 'text/html'}, ['Not Found']]
}
Test locally by executing bundle exec jekyll serve
.
Now run bundle install and add the Gemfile.lock to the repository and push the repository to heroku.
If this blog was helpful, check out our full blog archive.