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-26 14:41:54 -04:00
|
|
|
|
|
|
|
- run:
|
2018-06-18 16:58:17 -04:00
|
|
|
name: Build
|
|
|
|
command: yarn build-datatable
|
2018-06-18 16:58:58 -04:00
|
|
|
|
2018-06-26 14:55:36 -04:00
|
|
|
- run:
|
|
|
|
name: Copy README and LICENSE
|
|
|
|
command: |
|
|
|
|
cp LICENSE dist/ng-datatable/
|
|
|
|
cp README.md dist/ng-datatable/
|
|
|
|
|
2018-06-26 14:51:11 -04:00
|
|
|
- store_artifacts:
|
|
|
|
path: dist/ng-datatable
|
|
|
|
|
|
|
|
- deploy:
|
2018-06-18 17:02:56 -04:00
|
|
|
command: |
|
2018-06-26 14:46:03 -04:00
|
|
|
echo "${CIRCLE_BRANCH}"
|
2018-06-26 14:51:11 -04:00
|
|
|
if [ "${CIRCLE_BRANCH}" == "production" ]; then
|
2018-06-26 14:41:54 -04:00
|
|
|
yarn ci-publish
|
2018-06-18 16:58:58 -04:00
|
|
|
else
|
|
|
|
echo "Only the production branch is published"
|
2018-06-18 17:01:28 -04:00
|
|
|
fi
|