-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
.travis.yml
89 lines (79 loc) · 2.31 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# https://docs.travis-ci.com/user/job-lifecycle
language: node_js
node_js:
- '12.0'
git:
depth: 5
install:
- npm install --only=dev
env:
- DEPLOY=true
stages:
- test
- deploy:master
- deploy:branch
- deploy:docs
jobs:
include:
- stage: test
if: tag IS blank # filter double build with tags
script:
- npm run test
deploy:
edge: true
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
skip_cleanup: true
tag: test
on:
all_branches: true
before_deploy: # https://github.com/travis-ci/travis-ci/issues/1574#issuecomment-451787844
- if ! npm run ci:test:bd; then travis_terminate 1; fi
after_deploy: # the above link explains how to make the build fail if something went wrong
- if ! npm run ci:test:ad; then travis_terminate 1; fi
- stage: deploy:master
if: tag IS blank AND branch = master AND fork = false AND env(DEPLOY) = true
deploy:
edge: true
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
tag: latest
skip_cleanup: true
on:
all_branches: true
before_deploy:
- if ! npm run ci:master:bd; then travis_terminate 1; fi
after_deploy:
- if ! npm run ci:master:ad; then travis_terminate 1; fi
- stage: deploy:branch
if: tag IS blank AND branch != master AND fork = false AND env(DEPLOY) = true
deploy:
edge: true
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
tag: $TRAVIS_BRANCH
skip_cleanup: true
on:
all_branches: true
before_deploy:
- if ! npm run ci:branch:bd; then travis_terminate 1; fi
after_deploy:
- if ! npm run ci:branch:ad; then travis_terminate 1; fi
- stage: deploy:docs #deploys doc to gh-pages branch
if: tag IS blank AND branch = master AND fork = false AND env(DEPLOY) = true
deploy:
edge: true
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
local_dir: "docs"
keep_history: true
on:
all_branches: true
before_deploy:
- if ! npm run ci:docs:bd; then travis_terminate 1; fi
after_deploy:
- if ! npm run ci:docs:ad; then travis_terminate 1; fi