deploy.sh 665 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. if [ "$NODE_ENV" = production ]; then
  3. echo "info: skipping deploy in production builds"
  4. exit 0
  5. fi
  6. if [ ! "$GITHUB_TOKEN" ]; then
  7. >&2 echo "error: GITHUB_TOKEN not present in env"
  8. exit 1
  9. fi
  10. git config --global user.email "prettier-bot@users.noreply.github.com"
  11. git config --global user.name "Prettier Bot"
  12. echo "machine github.com login prettier-bot password $GITHUB_TOKEN" > ~/.netrc
  13. cd website
  14. export GIT_USER=prettier-bot
  15. export CIRCLE_BRANCH=$TRAVIS_BRANCH
  16. export CIRCLE_PROJECT_USERNAME=prettier
  17. export CIRCLE_PROJECT_REPONAME=prettier
  18. export CI_PULL_REQUEST=$TRAVIS_PULL_REQUEST_BRANCH
  19. yarn --pure-lockfile && yarn run publish-gh-pages