forked from initialspark/nhsuk-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
67 lines (61 loc) · 1.61 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
language: node_js
node_js:
- "lts/*"
cache:
directories:
- ~/.npm
- ~/.cache
services:
- docker
stages:
- tests
- name: master
if: branch = master
- name: tag
if: tag IS present
jobs:
include:
- stage: tests
name: Linting
script: npm run lint
- stage: tests
name: Jest
script: npm run jest:ci
- stage: tests
name: Backstop
before_script:
- npm start &
script:
# Usually the `backstop test --docker` command would be used to run the tests,
# but in travis we need to add a --network="host" flag to the docker-run command
# so we compose our own docker-run command.
- docker run --rm -it --network="host" --mount type=bind,source="/home/travis/build/nhsuk/nhsuk-frontend",target=/src backstopjs/backstopjs:latest test --config=tests/backstop/backstop.js --moby --testhost=http://127.0.0.1:3000
- stage: master
name: github pages
script: npm run build-gh-pages
deploy:
provider: pages
local-dir: ./dist/app
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
- stage: tag
name: publish to git releases
script: npm run build-gh-release
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: ./dist/nhsuk-frontend-*.zip
skip_cleanup: true
on:
tags: true
- stage: tag
name: publish to npm
deploy:
provider: npm
email: $NPM_EMAIL
api_key: $NPM_API_KEY
on:
tags: true
skip_cleanup: true