Ognjen Regoje bio photo

Ognjen Regoje
But you can call me Oggy


I make things that run on the web (mostly).
More ABOUT me and my PROJECTS.

me@ognjen.io LinkedIn

One line deployment for Jekyll sites

#jekyll #technical

A great way to deploy a Jekyll site using just rsync. First, build (jekyll b) the site locally and then rsync the _site folder:

rsync -av -e 'ssh -i ~/.ssh/id_passwordless_rsa' --delete _site/ ognjen.io:~/ognjen.io/_site

The -e 'ssh -i ~/.ssh/id_passwordless_rsa' is not actually required if you’re executing it manually. It’s there so that the command can be run in cron that cannot unlock key rings.

Old version

So ridiculous that I keep forgetting that you can pass a command to execute on the server instead of logging in and then executing it. I use that to “deploy” this site generated by Jekyll:

git push origin master && ssh ognjen.io 'cd ognjen.io;git pull origin master'

Add it to ~/.bashrc as an alias and never forget it again.

alias ognjendep='git push origin master && ssh ognjen.io "cd ognjen.io;git pull origin master"'