This Sinatra web app is used to update your Octopress blog automatically. When you make change to your blog and push up to Github, your changes will be pulled down and your blog will be regenerated.
Slick! Nothing is free, so you'll have to do a bit of configuration.
- Fork: https://github.com/austenito/heroku-buildpack-ruby-octopress
- In
config.yml
, edit the following:
- git_url - The read only URL of the blog you want to deploy on Heroku.
- git_branch - The branch your blog resides in.
- Run
rake setup
- Push your changes. When you deploy this repository on Heroku will pull this buildpack to setup and generate your blog.
In the Admin
section of your blog's Github repo add a post-receive URL. For example, http://www.jumpstartlab.com/generate
. A POST request will be submitted whenever you commit changes to your blog. This is how the server will pull your blog's latest changes from Github and generate the new static content.
For security, you may want to generate a hash string that will be difficult for people to guess.
-
Clone this repository.
-
In
config.yml
add the relative post-receive URL you added in the admin section of your blog on Github. Using the example above, you would use:generate
-
Run
rake --rakefile setup.rake
-
Deploy your blog!
heroku create --stack cedar --buildpack <your_buildpack_fork_git_url>
git add .
git commit -m "Your commit message"
git push heroku master
- Running
rake setup
in your buildpack repository changes the following lines in octopress.rb
pipe("env PATH=$PATH git remote add upstream ##git_url##")
pipe("env PATH=$PATH git pull upstream ##git_branch##")
- Running
rake -rakefile setup.rake
in this repository finds and replaces the post_receive_hook_url in server.rb
get /##git_post_receive_url##/ do