babble-on/deploy-blog.sh

28 lines
709 B
Bash

#!/bin/bash
printf "This script will deploy my blog; it will pull the newest files from the repository and put them into their appropriate folder.\n"
sleep 5
printf "Updating remote references ...\n"
git remote update
printf "Checking if branch is behind ...\n"
if [[ `git status -uno` == *"Your branch is up to date"* ]]; then
printf "Branch is not behind, not deploying.\n"
exit
else
printf "Branch is behind, deployment starting.\n"
sleep 2
printf "Pulling from remote origin ...\n"
git pull
printf "Building Jekyll site ...\n"
sleep 2
bundler exec jekyll build
printf "Moving _site directory to /var/www/ ...\n"
sleep 2
sudo cp -r _site/* /var/www/blog.marvinjohanning.de
fi