Skip to content

Instantly share code, notes, and snippets.

@tongueroo
Created August 30, 2015 22:06
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 tongueroo/01fff8bf1fc5f791f367 to your computer and use it in GitHub Desktop.
Save tongueroo/01fff8bf1fc5f791f367 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
set -e
# Setup git so we can use it
git config --global user.email "tongueroo@gmail.com"
git config --global user.name "CircleCI build_html script"
# remove changes from current gh-pages-ci branch
git checkout -f
git checkout master
# Make sure that local master matches with remote master
# CircleCI merges made changes to master so need to reset it
git fetch origin master
git reset --hard origin/master
# Gets _site/* files and pushes them to master branch
# Note: CircleCI creates vendor and .bundle files
mv _site /tmp/
rm -rf * .bundle .sass-cache
mv /tmp/_site/* .
git add -A .
git commit -m "CircleCI build_html: copy _site files that was generated from gh-pages-ci branch"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment