What is mgd ?
mgd stands for middleman-github-deploy and is a fork of jgd.
mgd will automatically build your Middleman blog and push it to your gh-pages branch (or branch of your choice).
Installation and Usage
It is assumed that your blog is in the home directory of your repo.
Install it first:
gem install mgd
Run it locally:
mgd
Now your site is deployed to gh-pages branch of your repo. Done.
PS. You can also specify target branch, with is gh-pages by default. Use
--branch command line option.
Deploying with Travis
This is how you might configure your blog to be deployed automatically by travis-ci:
branches:
only:
- master
env:
global:
- secure: ...
install:
- bundle
script: mgd -u http://yourname:[email protected]/yourname/blog.git
The environment variable $PASSWORD is set through
env/global/secure, as explained
here.
Don't forget to add gem require 'mgd' to your Gemfile.
You can use SSH key instead. First, you should encrypt it:
$ travis encrypt-file id_rsa --add
Then, use the URI that starts with git@:
script:
- mgd -u [email protected]:yourname/blog.git
Read also this article.