Simple jekyll deployment with a shell script and GitHub

I wanted to document and share my process for deploying this very website (

There are many ways to automate the deployment of a jekyll website. I tried a few methods but settled on a very simple ssh script I can run from my local computer. These steps could be used for any type of code deployment. It is not specific to a jekyll website.

Quick Summary

  • Execute the script on your local computer and enter your password when prompted
  • The script will then
    • connect and login to the remote server via ssh
    • git pull the entire project from GitHub into a private directory
    • Copy the contents of the _site folder your public website directory

Specific Setup and Configuration


Create the following scripts on your local computer. I prefer and would advise not to commit these to your project. I keep my deployment scripts on dropbox.



ssh 'bash -s' <



echo 'getting latest from github'
cd /home/private/
git pull -v

echo 'deploying to home/public'
cp -av /home/private/ /home/public/

echo '** done. deployed. **'

A couple notes about my environment. /home/private is a directory that cannot be accessed from the public facing internet. It is safe to keep the entire GitHub project here. The /home/public/ directory is the root directory serving this website (

You will need to do a one time change of permissions on the scripts in order be able to execute them. Run these commands on your local computer

chmod 755
chmod 755

Now I can deployment the site with one script. It will prompt me for my password then connect to the site via ssh, pull the latest from GitHub and update my website.

$ ./'s password:

That is all. Our website has been deployed!