2017-07-01 17:14:24 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2017-09-29 10:50:58 +02:00
|
|
|
if [ "$NODE_ENV" = production ]; then
|
|
|
|
|
echo "info: skipping deploy in production builds"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! "$GITHUB_TOKEN" ]; then
|
2017-07-01 17:14:24 -07:00
|
|
|
>&2 echo "error: GITHUB_TOKEN not present in env"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
git config --global user.email "prettier-bot@users.noreply.github.com"
|
|
|
|
|
git config --global user.name "Prettier Bot"
|
|
|
|
|
echo "machine github.com login prettier-bot password $GITHUB_TOKEN" > ~/.netrc
|
|
|
|
|
|
|
|
|
|
cd website
|
2017-07-02 10:42:25 +10:00
|
|
|
export GIT_USER=prettier-bot
|
|
|
|
|
export CIRCLE_BRANCH=$TRAVIS_BRANCH
|
|
|
|
|
export CIRCLE_PROJECT_USERNAME=prettier
|
|
|
|
|
export CIRCLE_PROJECT_REPONAME=prettier
|
2017-07-02 10:45:57 +10:00
|
|
|
export CI_PULL_REQUEST=$TRAVIS_PULL_REQUEST_BRANCH
|
2017-07-02 10:42:25 +10:00
|
|
|
yarn --pure-lockfile && yarn run publish-gh-pages
|