2019-09-14 12:31:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
2020-04-27 05:48:07 +00:00
|
|
|
BRANCH="gh-pages"
|
2019-09-14 12:31:49 +00:00
|
|
|
# Run the scan
|
|
|
|
|
|
|
|
cd website
|
|
|
|
bundle install
|
|
|
|
bundle show
|
|
|
|
bundle exec jekyll build --verbose --destination _site
|
|
|
|
|
2020-04-27 05:48:07 +00:00
|
|
|
git clone "$GIT_REMOTE" --branch "$BRANCH" /tmp/remote_site
|
|
|
|
|
2019-09-14 12:31:49 +00:00
|
|
|
if ([ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ]); then
|
2020-04-27 05:48:07 +00:00
|
|
|
cp -r _site/* /tmp/remote_site
|
|
|
|
cd /tmp/remote_site
|
2019-09-14 12:31:49 +00:00
|
|
|
git add .
|
2020-04-27 05:48:07 +00:00
|
|
|
git commit -m "Update: `date`"
|
|
|
|
git push --force --quiet origin > /dev/null 2>&1
|
2019-09-14 12:31:49 +00:00
|
|
|
echo 'Build successful, deployed to gh-pages.'
|
|
|
|
else
|
|
|
|
echo "Build successful, but not deploying!"
|
|
|
|
fi
|