2017-07-10 23:12:20 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-07-24 18:15:56 +01:00
|
|
|
set -uex
|
2017-07-10 23:12:20 +01:00
|
|
|
|
2017-07-24 18:15:56 +01:00
|
|
|
SITE_ENV="prod"
|
2017-07-24 17:16:20 +01:00
|
|
|
REPO=`git config remote.origin.url`
|
|
|
|
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
|
2017-07-24 18:07:24 +01:00
|
|
|
SHA=`git rev-parse --verify HEAD`
|
2017-07-24 19:23:40 +01:00
|
|
|
TARGET_BRANCH="master"
|
2017-07-24 17:16:20 +01:00
|
|
|
|
2017-07-14 23:16:24 +01:00
|
|
|
# Build front-end assets.
|
2017-07-20 18:58:25 +01:00
|
|
|
npm run prod
|
2017-07-14 23:16:24 +01:00
|
|
|
|
2017-07-10 23:12:20 +01:00
|
|
|
# Remove the existing docs directory, build the site and create the new
|
|
|
|
# docs directory.
|
|
|
|
rm -rf ./docs
|
|
|
|
vendor/bin/sculpin generate --no-interaction --clean --env=${SITE_ENV}
|
|
|
|
touch output_${SITE_ENV}/.nojekyll
|
|
|
|
mv output_${SITE_ENV} docs
|
|
|
|
|
|
|
|
# Add, commit and push the changes.
|
2017-07-24 19:36:58 +01:00
|
|
|
git checkout $TARGET_BRANCH
|
2017-07-10 23:12:20 +01:00
|
|
|
git add --all docs
|
2017-07-24 18:07:24 +01:00
|
|
|
git commit -m "Re-generate site. $SHA"
|
2017-07-24 19:23:40 +01:00
|
|
|
git push $SSH_REPO $TARGET_BRANCH
|