Skip to content

Commit

Permalink
Autobuild website on Travis from stable branch
Browse files Browse the repository at this point in the history
$REACT_WEBSITE_BRANCH in https://travis-ci.org/facebook/react/settings/env_vars now needs to point to the stable branch (currently 0.13-stable). I haven't tested the commit-and-push part of this but everything else works so I'm hopeful.
  • Loading branch information
sophiebits committed Mar 30, 2015
1 parent b20778a commit accb4f6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ vendor/jasmine-jsreporter/
# But not in docs/_js/examples/*
docs/_js/*.js
docs/js/
# gems
docs/vendor/bundle/
# This should be more like examples/**/thirdparty/** but
# we should fix /~https://github.com/facebook/esprima/pull/85 first
examples/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ __benchmarks__
build/
.module-cache
*.gem
docs/.bundle
docs/code
docs/_site
docs/.sass-cache
docs/js/*
docs/downloads
docs/vendor/bundle
examples/shared/*.js
test/the-files-to-test.generated.js
*.log*
Expand Down
36 changes: 33 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,43 @@ node_js:
sudo: false
cache:
directories:
- docs/vendor/bundle
- node_modules
before_install:
- |
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || {
if [ "$TEST_TYPE" != build_website ] && \
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
then
echo "Only docs were updated, stopping build process."
exit
}
fi
script:
- |
grunt $TEST_TYPE
if [ "$TEST_TYPE" = build_website ]; then
if [ "$TRAVIS_BRANCH" = "$REACT_WEBSITE_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
set -e
GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/../react-gh-pages
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
git clone --branch gh-pages --depth=50 \
https://reactjs-bot@github.com/facebook/react.git \
$GH_PAGES_DIR
pushd docs
bundle install --jobs=3 --retry=3 --path=vendor/bundle
bundle exec rake release
cd $GH_PAGES_DIR
git status
if ! git diff-index --quiet HEAD --; then
git add -A .
git commit -m "Rebuild website"
git push
fi
popd
fi
else
grunt $TEST_TYPE
fi
after_script:
- |
if [ "$TEST_TYPE" = test ] && [ "$SERVER" ]; then
Expand All @@ -39,12 +66,15 @@ env:
- TEST_TYPE=test
- TEST_TYPE=jest
- TEST_TYPE=lint
- TEST_TYPE=build_website
- TEST_TYPE=test:webdriver:saucelabs:modern
global:
# SERVER
- secure: qPvsJ46XzGrdIuPA70b55xQNGF8jcK7N1LN5CCQYYocXLa+fBrl+fTE77QvehOPhqwJXcj6kOxI+sY0KrVwV7gmq2XY2HZGWUSCxTN0SZlNIzqPA80Y7G/yOjA4PUt8LKgP+8tptyhTAY56qf+hgW8BoLiKOdztYF2p+3zXOLuA=
# SECRET_TOKEN
- secure: dkpPW+VnoqC/okhRdV90m36NcyBFhcwEKL3bNFExAwi0dXnFao8RoFlvnwiPlA23h2faROkMIetXlti6Aju08BgUFV+f9aL6vLyU7gUent4Nd3413zf2fwDtXIWIETg6uLnOpSykGKgCAT/hY3Q2oPLqOoY0OxfgnbqwxkxljrE=
# GITHUB_TOKEN
- secure: EHCyCSKMwKlLHNtcj9nmkRzmiiPE3aDGlPcnEyrDJeRI0SeN/iCXHXfFivR0vFq3vr+9naMBczAR2AEidtps5KbJrKqdZnjPFRbmfVtzWr/LlvVCub3u13Pub6TdKIVBTny1PuZ5X8GvdxMNVig89jGjvzhhWuQRaz3VhJnTra4=
matrix:
fast_finish: true
allow_failures:
Expand Down
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ exclude:
- Gemfile.lock
- README.md
- Rakefile
- vendor/bundle
markdown: redcarpet
redcarpet:
extensions:
Expand Down

0 comments on commit accb4f6

Please sign in to comment.