forked from Github/ocrcc-chatbox
45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
version: 2
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: node:10
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: dep install
|
|
command: npm install
|
|
- run:
|
|
name: install codecov
|
|
command: npm install -g codecov
|
|
- run:
|
|
name: test
|
|
command: npm test && codecov
|
|
- run:
|
|
name: build
|
|
command: |
|
|
npm run build
|
|
[ -f ./dist/index.html ] || exit 1
|
|
[ -f ./dist/blank.html ] || exit 1
|
|
[ -f ./dist/widget.js ] || exit 1
|
|
[ -f ./dist/bookmarklet.js ] || exit 1
|
|
- run:
|
|
name: deploy
|
|
command: |
|
|
if [ "$CIRCLE_BRANCH" = "master" ]; then
|
|
git config --global user.email $GH_EMAIL
|
|
git config --global user.name $GH_NAME
|
|
npm run deploy
|
|
fi
|
|
|
|
workflows:
|
|
version: 2
|
|
build-deploy:
|
|
jobs:
|
|
- build
|
|
- deploy:
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: master
|