-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
46 lines (39 loc) · 1.46 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
# -------------------------
# this script allows you to
# -------------------------
# - test your code (unit + e2e)
# - deploy your final build on GH pages
# -----------------------------------------
# in order to use CI and CD on your project
# -----------------------------------------
# - change Github username and repo in `script`
# - go to https://travis-ci.org/YOUR-GITHUB-USERNAME/YOUR-GITHUB-REPO/settings
# - activate travis for that repo
# - define a GITHUB_TOKEN within the `Environment Variables`
# - get that token from your Github account: https://github.com/settings/tokens
# - `Generate new token`, give any name you want and select `public_repo`
sudo: false
language: node_js
node_js: 8
cache: yarn
install:
- yarn install --frozen-lockfile --non-interactive
- yarn global add http-server
script:
- yarn run check
- yarn run test:ci
- yarn run build:prod -- --progress=false --base-href "https://maxime1992.github.io/angular-ngrx-starter/"
- sed -i 's/<base href="https:\/\/maxime1992.github.io\/angular-ngrx-starter\/">/<base href="\/">/g' dist/index.html
- nohup http-server dist &
- wait-on http://localhost:8080
- export CYPRESS_BASE_URL=http://localhost:8080
- yarn run cypress:ci
- sed -i 's/<base href="\/">/<base href="https:\/\/maxime1992.github.io\/angular-ngrx-starter\/">/g' dist/index.html
- yarn run postbuild
deploy:
skip_cleanup: true
provider: pages
github_token: $GITHUB_TOKEN
local_dir: dist
on:
branch: master