diff --git a/.travis.yml b/.travis.yml index 2911216d8..55f089196 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,19 @@ after_script: - rm packager.pid # Automatically publish the website -after_success: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' +after_success: +- | + if [ "$TRAVIS_PULL_REQUEST" = false ] && [ "$TRAVIS_BRANCH" = master ]; then + echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc + cd website + npm install + ./setup.sh + ./publish.sh + fi env: - - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" + global: + - secure: "HlmG8M2DmBUSBh6KH1yVIe/8gR4iibg4WfcHq1x/xYQxGbvleq7NOo04V6eFHnl9cvZCu+PKH0841WLnGR7c4BBf47GVu/o16nXzggPumHKy++lDzxFPlJ1faMDfjg/5vjbAxRUe7D3y98hQSeGHH4tedc8LvTaFLVu7iiGqvjU=" branches: only: diff --git a/website/setup.sh b/website/setup.sh index 01c57317b..9509848b6 100755 --- a/website/setup.sh +++ b/website/setup.sh @@ -8,7 +8,11 @@ # of patent rights can be found in the PATENTS file in the same directory. cd ../../ -git clone git://github.com/facebook/react-native.git react-native-gh-pages +if [ "$TRAVIS" ]; then + git clone "https://reactjs-bot@github.com/facebook/react-native.git" react-native-gh-pages +else + git clone git://github.com/facebook/react-native.git react-native-gh-pages +fi cd react-native-gh-pages git checkout origin/gh-pages git checkout -b gh-pages