Continuous Deployment with Middleman and Codeship

Github -> Codeship -> BitBalloon

We recently ported the BitBalloon homepage to Middleman, a ruby based static site generator that’ll make you feel right at home if you’re used to Ruby on Rails development.

In this post you’ll see how we setup continuous deployment for our Middleman site with Codeship, a very affordable hosted continuous integration service.

First step is obviously to start a middleman site. If you’re starting a new one from scratch, here’s how it looks like:

gem install middleman
middleman init my-site

This creates a new Middleman site that you can start working on. Create a new repository for your site on github and push your site there.

Alternatively, you can just fork our homepage from Github.

Your first BitBalloon deploy

Before moving on, you’ll want to do your first BitBalloon deploy manually.

First add this to your Gemfile:

gem "bitballoon"

Now go grab a BitBalloon API key at

With your API key ready, you can do your first deploy:

bundle install
bundle exec middleman build
bundle exec bitballoon deploy build

This will first install all the dependencies, then run Middleman to build your site and finally deploy the build directory to BitBalloon.

Once the site is deployed, the BitBalloon commandline tool stores a file in your Middleman dir called .bitballoon with an access token and the ID of the site you deployed. You’ll normally want to add this file to your .gitignore file.

Configuring Codeship

Now that your Middleman site is live on BitBalloon, it’s time to get continuous deploys setup. Signup for Codeship and then create a new project.

Step 1 - Choose Your Provider

Pick GitHub as your provider and select the repository with your Middleman site. Once you’ve picked your repository, Codeship will ask you to configure your tests.

Pick Ruby from the Select your technology to prepopulate basic commands dropdown. Then Modify your test command to:

bundle exec middleman build

Instead of clicking the big green “Save and go to dashboard” button, follow the “save and continue your setup” link. Select the Master branch of your repository and then make sure to pick the $script option.

Step 2 - Pick the Script Option

In the big deployment commands textbox, just type:

bundle exec bitballoon deploy build --access-token=YOUR_ACCESS_TOKEN --site-id=YOUR_SITE_ID

Replace the access token and site id with the values from your .bitballoon file. Save and finish, and Codeship will start building and deploying your site.

It can all be done in just a few minutes and this flow will serve you all the way from prototyping till a production site with millions of visitors.

Step 3 - Success

Interested in Continuous Deployment?

We now recommend using netlify for Continuous Deployment.
It's our premium hosting platform and makes settings up continuous deployment of any static site as simple as it gets.

Get started now