Choices/.travis.yml
Josh Johnson 55b356ec69
Add travis pipeline (#516)
* Update travis.yml

* Simplify ci pipeline

* Include css in bundle size check

* Set npm username via env var

* Specify branches

* Add build scripts

* Consistent ifs

* Add linting stage to pipeline

* Cache npm

* Cache cypress & npm folders + install using ci method

* Unignore package-lock
2019-02-12 18:04:50 +00:00

44 lines
928 B
YAML

language: node_js
node_js:
- 10
cache:
directories:
- ~/.npm
- ~/.cache
install:
- npm ci
jobs:
include:
- stage: Judging bundle size
script: npm run bundlesize
- stage: Linting code
script: npm run lint
- stage: Running tests
script: npm run test
- stage: Building for publish
if: branch = master
script: npm run build && npm run bump-cache
- stage: Publishing to NPM
if: branch = master
script: echo "Publishing to NPM..."
deploy:
provider: npm
email: $NPM_EMAIL_ADDRESS
api_key: $NPM_API_KEY
skip_cleanup: true
on:
tags: true
- stage: Publishing to GitHub releases
if: branch = master
script: echo "Publishing to Github releases..."
deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
skip_cleanup: true
on:
tags: true