forked from alphagov/paste-html-to-govspeak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
42 lines (42 loc) · 1.1 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
language: node_js
node_js:
- lts/*
script:
- npm run test
- npm run build
after_success:
- export LOCAL_VERSION=$(node -p "require('./package.json').version")
- export REMOTE_VERSION=$(npm view paste-html-to-govspeak version)
- export GIT_TAG=$(git tag | grep $LOCAL_VERSION)
- export GIT_REMOTE=https://[email protected]/$TRAVIS_REPO_SLUG
deploy:
# This deploy requires a Github personal access token, so if this breaks it
# could be that the developer has left GDS.
- provider: pages
edge: true
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
local_dir: examples
on:
branch: master
- provider: script
edge: true
skip_cleanup: true
script: git tag $LOCAL_VERSION && git push $GIT_REMOTE --tags
on:
branch: master
condition: -z $GIT_TAG
- provider: npm
edge: true
skip_cleanup: true
email: [email protected]
api_key: $NPM_TOKEN
on:
branch: master
condition: $LOCAL_VERSION != $REMOTE_VERSION
cache:
directories:
- node_modules
notifications:
email: false