67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
# Javascript Node CircleCI 2.0 configuration file
|
|
#
|
|
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
|
|
#
|
|
version: 2
|
|
|
|
defaults: &defaults
|
|
working_directory: ~/repo
|
|
docker:
|
|
- image: circleci/node:10.12.0-browsers
|
|
|
|
jobs:
|
|
test:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
# Download and cache dependencies
|
|
- restore_cache:
|
|
keys:
|
|
- v3-dependencies-{{ checksum "package.json" }}
|
|
# fallback to using the latest cache if no exact match is found
|
|
- v3-dependencies-
|
|
- run: yarn install --frozen-lockfile
|
|
- save_cache:
|
|
paths:
|
|
- node_modules
|
|
key: v2-dependencies-{{ checksum "package.json" }}
|
|
|
|
# run lint
|
|
- run: npm run lint
|
|
|
|
# run tests
|
|
- run: npm run test:bs
|
|
|
|
- persist_to_workspace:
|
|
root: ~/repo
|
|
paths: .
|
|
deploy:
|
|
<<: *defaults
|
|
steps:
|
|
# will add github as known host
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ~/repo
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- "df:41:a0:89:d0:a1:30:7d:08:38:d6:65:73:61:a4:ec"
|
|
- run:
|
|
name: Authenticate with registry
|
|
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
- run: git config --global user.email circleci@circleci
|
|
- run: git config --global user.name CircleCI
|
|
- run:
|
|
name: Publish package
|
|
command: "./node_modules/.bin/lerna publish --message 'chore: release new versions' --yes"
|
|
|
|
workflows:
|
|
version: 2
|
|
test-deploy:
|
|
jobs:
|
|
- test
|
|
- deploy:
|
|
requires:
|
|
- test
|
|
filters:
|
|
branches:
|
|
only: master
|