Skip to content

Instantly share code, notes, and snippets.

@alexblackie
Created January 31, 2013 09:39
Show Gist options
  • Save alexblackie/4681698 to your computer and use it in GitHub Desktop.
Save alexblackie/4681698 to your computer and use it in GitHub Desktop.
Deploy a Middleman site by building it server-side on a Git post-receive (making deployment as easy as "git push").
#!/bin/sh
# Simply point your virtualhost to the GIT_WORK_TREE below, with "/build" appended. (ex: /path/to/webroot/example.com/build)
# This is how I manage all of my sites. I highly recommend this setup.
GIT_WORK_TREE=/path/to/webroot/example.com # Set this to your webroot path (sans build)
export GIT_WORK_TREE
git checkout -f
# Enter Directory
cd $GIT_WORK_TREE
# Install Gems
bundle install
# Build Middleman
bundle exec middleman build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment