Skip to content

Instantly share code, notes, and snippets.

@cayblood
Created April 12, 2019 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cayblood/6d2304a805a1187b9a1c8388cd4ee9c2 to your computer and use it in GitHub Desktop.
Save cayblood/6d2304a805a1187b9a1c8388cd4ee9c2 to your computer and use it in GitHub Desktop.
Saltaires static web site deployment script
#!/bin/bash
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
cd /Users/cayblood/Source/hobby/saltaires.org/new
nvm use 7.4.0
git checkout master
npm install
bower install
cd jekyll-site
jekyll build
cd ..
rm -rf /tmp/_site
cp -r jekyll-site/_site /tmp
cd /Users/cayblood/Source/hobby/saltaires.org/saltaires-deploy
git checkout gh-pages
rm -rf /Users/cayblood/Source/hobby/saltaires.org/saltaires-deploy/*
mv /tmp/_site/* .
echo -e "www.saltaires.org\n" > CNAME
git add .
git commit -m "deploy"
git push -f origin gh-pages:gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment