Makzan / I share what I learned

Periodically deploying Middleman static site

The new makzan.net is built on top of Middleman static site generator. Then I deploy the site as a Github pages.

I use 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.

1
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

The source is to make the rvm and node environment works from the cron environment.


Published on 2015-09-19. More articles like this:
- Web Technologies

Previous <- Configure files to copy without middleman building process
Next -> Have a well defined done state

📬 Subscribe to Makzan’s Weekly Dispatch

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:

What to expect: If you wish to withdraw your consent and stop hearing from us, simply click the unsubscribe link at the bottom of every email we send or contact us at mak@makzan.net. We value and respect your personal data and privacy. To view our privacy policy, please visit our website. By submitting this form, you agree that we may process your information in accordance with these terms.