-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (45 loc) · 1.32 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
language: node_js
node_js:
- "12"
cache: yarn
env:
global:
- GIT_NAME="uikenshoo"
- GIT_EMAIL="[email protected]"
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- yarn prettier
- yarn test
- yarn build
- if [ "$BRANCH" == "master" ];
then
yarn workspace @kenshooui/react-tree-docs chromatic --auto-accept-changes;
elif [[ $TRAVIS_EVENT_TYPE != 'pull_request' || $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]];
then
yarn workspace @kenshooui/react-tree-docs chromatic;
fi
after_success:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- yarn build-storybook
before_deploy:
- if [ "$BRANCH" == "master" ]; then
git checkout master;
git fetch --tags;
fi;
deploy:
- provider: script
script: if [ "$GH_TOKEN" != "false" ]; then npx auto shipit; fi;
skip-cleanup: true
on:
all_branches: true
- provider: pages
local-dir: "./storybook-static"
skip-cleanup: true
github-token: $GH_TOKEN
keep-history: true
on:
branch: master