2015-04-08 23:00:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2015-04-09 16:07:32 +00:00
|
|
|
ENV='prod'
|
|
|
|
REPO='git@github.com:opdavies/opdavies.github.io.git'
|
|
|
|
BRANCH='master'
|
|
|
|
BUILD_DIR='./gh-pages-deployment/'
|
|
|
|
|
|
|
|
rm -rf ./output_${ENV}
|
2015-04-09 16:31:44 +00:00
|
|
|
sculpin generate --env=${ENV}
|
2015-04-08 23:00:23 +00:00
|
|
|
|
|
|
|
LOG=$(git log --oneline -n 1)
|
|
|
|
|
2015-04-09 16:07:32 +00:00
|
|
|
rm -rf ${BUILD_DIR}
|
|
|
|
git clone ${REPO} ${BUILD_DIR}
|
2015-04-08 23:00:23 +00:00
|
|
|
|
2015-04-09 16:07:32 +00:00
|
|
|
pushd ${BUILD_DIR}
|
|
|
|
git checkout -B ${BRANCH}
|
|
|
|
rsync --quiet --archive --filter="P .git*" --delete ../output_${ENV}/ ./
|
2015-04-08 23:00:23 +00:00
|
|
|
git add -A .
|
|
|
|
git commit -m "${LOG}"
|
2015-04-09 16:07:32 +00:00
|
|
|
git push origin ${BRANCH} --force
|
2015-04-08 23:00:23 +00:00
|
|
|
popd
|