Periodically deploying Middleman static site
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 deploycommand 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.
Published on September 19, 2015. More articles like this: Web Technologies.
Want productive tips and web technologies links like this in your inbox each week? Sign up for weekly dispatch each week. No spam ever. Just useful content: