You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 line
582 B

  1. #!/bin/bash
  2. set -o errexit -o nounset
  3. if [ "$TRAVIS_BRANCH" != "master" ]
  4. then
  5. echo "This commit was made against $TRAVIS_BRANCH and not master! No deploy!"
  6. exit 0
  7. fi
  8. rev=$(git rev-parse --short HEAD)
  9. mkdir deploy
  10. cd deploy
  11. git init
  12. git config --global user.name "Travis CI"
  13. git config --global user.email "builds@travis-ci.org"
  14. git remote add upstream "https://$GH_TOKEN@github.com/toddmotto/public-apis.git"
  15. git fetch upstream
  16. git reset upstream/master
  17. mv ../../json .
  18. git add json/
  19. git commit -m "rebuild JSON at ${rev}" -m "[ci skip]"
  20. git push upstream HEAD:master