middleman-deploy gem to setup the Github pages deployment, which I follow their default setting:
1 2 3 4
activate :deploy do |deploy| deploy.build_before = true deploy.method = :git end
I use Cloud9 for development and run the following cron job hourly.
5 * * * * /project_path/build_and_deploy.sh > /project_path/cron.log 2>&1
In which, the
build_and_deploy.sh executes the
middleman deploy command under the project folder.
1 2 3 4 5 6 7 8
!/usr/bin/env bash source /usr/local/rvm/environments/ruby-2.2.1 source /home/ubuntu/.nvm/nvm.sh cd /project_path middleman deploy
source is to make the
node environment works from the cron environment.