Autobuild website on Travis from stable branch
$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.
Ben Alpert committed
Mar 27, 2015 at 20:15 UTC
accb4f6047ac5d8ff2907e32fbf9c1a68691aa83
4 files changed
+38
-3
.eslintignore
+2
@@ -14,6 +14,8 @@ vendor/jasmine-jsreporter/
14
# But not in docs/_js/examples/*
15
docs/_js/*.js
16
docs/js/
17
+# gems
18
+docs/vendor/bundle/
19
# This should be more like examples/**/thirdparty/** but
20
# we should fix https://github.com/facebook/esprima/pull/85 first
21
examples/
.gitignore
+2
@@ -9,11 +9,13 @@ __benchmarks__
9
build/
10
.module-cache
11
*.gem
12
+docs/.bundle
13
docs/code
14
docs/_site
15
docs/.sass-cache
16
docs/js/*
17
docs/downloads
18
+docs/vendor/bundle
19
examples/shared/*.js
20
test/the-files-to-test.generated.js
21
*.log*
.travis.yml
+33
-3
@@ -5,16 +5,43 @@ node_js:
5
sudo: false
6
cache:
7
directories:
8
+ - docs/vendor/bundle
9
- node_modules
10
before_install:
11
- |
11
- git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || {
12
+ if [ "$TEST_TYPE" != build_website ] && \
13
+ git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
14
+ then
15
echo "Only docs were updated, stopping build process."
16
exit
14
- }
17
+ fi
18
script:
19
- |
17
- grunt $TEST_TYPE
20
+ if [ "$TEST_TYPE" = build_website ]; then
21
+ if [ "$TRAVIS_BRANCH" = "$REACT_WEBSITE_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
22
+ set -e
23
+
24
+ GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/../react-gh-pages
25
+ echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
26
+
27
+ git clone --branch gh-pages --depth=50 \
28
+ https://reactjs-bot@github.com/facebook/react.git \
29
+ $GH_PAGES_DIR
30
+ pushd docs
31
+ bundle install --jobs=3 --retry=3 --path=vendor/bundle
32
+ bundle exec rake release
33
+ cd $GH_PAGES_DIR
34
+ git status
35
+ if ! git diff-index --quiet HEAD --; then
36
+ git add -A .
37
+ git commit -m "Rebuild website"
38
+ git push
39
+ fi
40
+ popd
41
+ fi
42
+ else
43
+ grunt $TEST_TYPE
44
+ fi
45
after_script:
46
- |
47
if [ "$TEST_TYPE" = test ] && [ "$SERVER" ]; then
@@ -39,12 +66,15 @@ env:
66
- TEST_TYPE=test
67
- TEST_TYPE=jest
68
- TEST_TYPE=lint
69
+ - TEST_TYPE=build_website
70
- TEST_TYPE=test:webdriver:saucelabs:modern
71
global:
72
# SERVER
73
- secure: qPvsJ46XzGrdIuPA70b55xQNGF8jcK7N1LN5CCQYYocXLa+fBrl+fTE77QvehOPhqwJXcj6kOxI+sY0KrVwV7gmq2XY2HZGWUSCxTN0SZlNIzqPA80Y7G/yOjA4PUt8LKgP+8tptyhTAY56qf+hgW8BoLiKOdztYF2p+3zXOLuA=
74
# SECRET_TOKEN
75
- secure: dkpPW+VnoqC/okhRdV90m36NcyBFhcwEKL3bNFExAwi0dXnFao8RoFlvnwiPlA23h2faROkMIetXlti6Aju08BgUFV+f9aL6vLyU7gUent4Nd3413zf2fwDtXIWIETg6uLnOpSykGKgCAT/hY3Q2oPLqOoY0OxfgnbqwxkxljrE=
76
+ # GITHUB_TOKEN
77
+ - secure: EHCyCSKMwKlLHNtcj9nmkRzmiiPE3aDGlPcnEyrDJeRI0SeN/iCXHXfFivR0vFq3vr+9naMBczAR2AEidtps5KbJrKqdZnjPFRbmfVtzWr/LlvVCub3u13Pub6TdKIVBTny1PuZ5X8GvdxMNVig89jGjvzhhWuQRaz3VhJnTra4=
78
matrix:
79
fast_finish: true
80
allow_failures:
docs/_config.yml
+1
@@ -25,6 +25,7 @@ exclude:
25
- Gemfile.lock
26
- README.md
27
- Rakefile
28
+- vendor/bundle
29
markdown: redcarpet
30
redcarpet:
31
extensions: