diff --git a/.travis.yml b/.travis.yml index cdcdfc9..b6f2197 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,17 @@ language: node_js node_js: - "12" +cache: yarn + +script: + - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) + - yarn build + - cd ./packages/docs + - yarn install + - if [ "$BRANCH" == "master" ]; + then + yarn chromatic --auto-accept-changes; + elif [[ $TRAVIS_EVENT_TYPE != 'pull_request' || $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]]; + then + yarn chromatic; + fi \ No newline at end of file diff --git a/packages/docs/package.json b/packages/docs/package.json index 2baae2a..655d7cc 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -17,8 +17,7 @@ "dependencies": {}, "scripts": { "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook", - "chromatic:rebase": "chromatic --auto-accept-changes", + "build-storybook": "build-storybook --quiet", "chromatic": "chromatic --exit-zero-on-changes" } }