-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
39 lines (39 loc) · 1.35 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
language: node_js
cache:
yarn: true
directories:
- node_modules
install:
- yarn
- npm install -g codecov
script:
- yarn build:sync
- yarn test
- codecov
- yarn build:dist # the dist build is only used to track bundle size delta
- yarn bundlesize
before_deploy:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc # we only want to run this on deploys as this guarantees we have an NPM_TOKEN env var
# only create releases folder once, before_deploy gets called before every provider so save time by only doing once
- if [ ! -d "releases" ]; then yarn run pack && mkdir releases && mv {components,packages}/*/govuk-frederic-*.tgz ./releases; fi
- LERNA_VERSION=$(node -e 'console.log(require("./lerna.json").version)')
deploy:
- provider: pages # https://docs.travis-ci.com/user/deployment/pages/
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in travis-ci.org dashboard, marked secure
keep-history: true
local-dir: packages/storybook/storybook-static
on:
branch: master
- provider: script
skip_cleanup: true
script: lerna exec --no-private --bail=false -- "can-npm-publish && npm publish"
on:
tags: true
- provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: "releases/govuk-frederic-*-${LERNA_VERSION}.tgz"
skip_cleanup: true
on:
tags: true