2018-06-18 16:34:16 -04:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2018-06-18 16:40:16 -04:00
|
|
|
- image: circleci/node:10.4-browsers
|
2018-06-18 16:34:16 -04:00
|
|
|
|
|
|
|
working_directory: ~/repo
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-dependencies-{{ checksum "package.json" }}
|
|
|
|
- v1-dependencies-
|
|
|
|
|
2018-06-18 16:58:17 -04:00
|
|
|
- run:
|
|
|
|
name: Install
|
|
|
|
command: yarn
|
2018-06-18 16:34:16 -04:00
|
|
|
|
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
key: v1-dependencies-{{ checksum "package.json" }}
|
|
|
|
|
2018-06-18 16:58:17 -04:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: yarn build-datatable
|
|
|
|
|
2018-06-18 16:58:58 -04:00
|
|
|
- save_cache:
|
2018-06-18 16:58:17 -04:00
|
|
|
paths:
|
|
|
|
- dist/ng-datatable
|
|
|
|
key: v1-dist-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
|
2018-06-18 16:58:58 -04:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Publish
|
|
|
|
command:
|
|
|
|
if ["${CIRCLE_BRANCH}" === "production"]; then
|
|
|
|
cd dist/ng-datatable
|
|
|
|
npm publish
|
|
|
|
else
|
|
|
|
echo "Only the production branch is published"
|
2018-06-18 17:01:28 -04:00
|
|
|
fi
|