Ognjen Regoje bio photo

MY NAME IS
Ognjen Regoje
BUT YOU CAN CALL ME OGGY


I make things that run on the web (mostly).
More /ABOUT me.

me@ognjen.io Twitter LinkedIn Instagram Github

One line deployment for Jekyll sites

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"'

#jekyll #technical