From 89f751e651324a04bc7e4c3b35746d97bbdc1854 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Sat, 24 Sep 2016 18:14:52 -0400 Subject: [PATCH] Publish playground to gh-pages --- .travis.yml | 16 ++++++++++++++++ package.json | 2 ++ 2 files changed, 18 insertions(+) diff --git a/.travis.yml b/.travis.yml index 00dd791d5..e256250e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,19 @@ sudo: false cache: directories: - node_modules +after_script: +- | + # RELEASE_BRANCHES and NPM_TOKEN defined in Travis settings panel + declare exitCode + $(npm bin)/travis-after-all + exitCode=$? + if [[ + $exitCode = 0 && + $RELEASE_BRANCHES =~ $TRAVIS_BRANCH && + $TRAVIS_PULL_REQUEST = "false" + ]]; then + ./node_modules/.bin/gh-pages -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git -d playground -m "Travis build ${TRAVIS_BUILD_NUMBER}" + git config --global user.email $(git log --pretty=format:"%ce" -n1) + git config --global user.name $(git log --pretty=format:"%cn" -n1) + ./node_modules/.bin/gh-pages -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git -d playground -m "Build for $(git log --pretty=format:%H)" + fi diff --git a/package.json b/package.json index f4edc1d90..9be088a02 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "copy-webpack-plugin": "3.0.1", "eslint": "2.7.0", "expose-loader": "0.7.1", + "gh-pages": "0.11.0", "highlightjs": "8.7.0", "htmlparser2": "3.9.0", "json-loader": "0.5.4", @@ -30,6 +31,7 @@ "script-loader": "0.7.0", "stats.js": "0.16.0", "tap": "5.7.1", + "travis-after-all": "1.4.4", "webpack": "1.13.0", "webpack-dev-server": "1.14.1" }