2017-07-10 22:12:20 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-07-24 17:15:56 +00:00
|
|
|
set -uex
|
2017-07-10 22:12:20 +00:00
|
|
|
|
2017-07-24 17:15:56 +00:00
|
|
|
SITE_ENV="prod"
|
2017-07-24 16:16:20 +00:00
|
|
|
REPO=`git config remote.origin.url`
|
|
|
|
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
|
2017-07-24 17:52:58 +00:00
|
|
|
echo $SSH_REPO
|
2017-07-24 17:07:24 +00:00
|
|
|
SHA=`git rev-parse --verify HEAD`
|
2017-07-24 17:52:58 +00:00
|
|
|
echo $SHA
|
2017-07-24 16:16:20 +00:00
|
|
|
|
2017-07-14 22:16:24 +00:00
|
|
|
# Build front-end assets.
|
2017-07-20 17:58:25 +00:00
|
|
|
npm run prod
|
2017-07-14 22:16:24 +00:00
|
|
|
|
2017-07-10 22:12:20 +00: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.
|
|
|
|
git add --all docs
|
2017-07-24 17:07:24 +00:00
|
|
|
git commit -m "Re-generate site. $SHA"
|
2017-07-24 16:22:47 +00:00
|
|
|
git push $SSH_REPO master
|