Skip to content

Instantly share code, notes, and snippets.

@tompave
Last active May 30, 2016 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompave/b542565fedd4e928e6edeb63cb089ec2 to your computer and use it in GitHub Desktop.
Save tompave/b542565fedd4e928e6edeb63cb089ec2 to your computer and use it in GitHub Desktop.
Build a Middleman site and commit it to an orphan master branch, see the related blog post for the setup: http://tommaso.pavese.me/2016/05/22/how-to-deploy-a-middleman-website-to-github-pages/
#!/bin/bash
middleman build &&
echo "--- middleman build complete"
git checkout master &&
echo "--- cleaning old build"
(ls -1 | grep -v 'build' | xargs rm -rf ) &&
echo "--- copying new build to the root level"
cp -R build/* ./ &&
rm -rf build &&
echo "--- committing"
git add . &&
git commit --message "Automated commit at $(date +"%Y-%m-%d %H:%M:%S %Z")" &&
echo "--- done"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment