A simple Jekyll deploy

Since this site is build with Jekyll and I'm quickly frustrated by boring and cumbersome tasks, I needed a simple and quick way to deploy this blog to my vps in a matter of seconds.

As this blog is not hosted on Github Pages nor on S3, most tutorials online are of no help. My solution consists of a simple Makefile with 4 commands, which is all I need for this project.

make install sets up the local jekyll environment including all gems specified in my Gemfile. make build just wraps jekyll build. Because of this I can use the build command as a dependcy for other commands. jekyll run wraps jekyll serve and is only of use in the local context. make deploy then uses rsync to sync the local _site folder to the document root of my fully configured webserver.

install:
    bundle install

build: jekyll build

run: jekyll serve

deploy: install build rsync -avr --rsh='ssh' --delete-after --delete-excluded site/ user@host:/var/www/docroot

In the future I may enhance this with more commands to automatically set up the remote webserver etc.