Skip to content

Commit

Permalink
chore: remove npm run build, fix ci deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
BuptStEve committed Feb 13, 2019
1 parent 8074a9c commit eb06a4c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 25 deletions.
64 changes: 41 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,64 @@
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/node:latest

working_directory: ~/repo
defaults: &defaults
docker:
- image: circleci/node:latest
working_directory: ~/project/repo

jobs:
install:
<<: *defaults
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- persist_to_workspace:
root: ~/project
paths:
- repo

test:
<<: *defaults
steps:
- attach_workspace:
at: ~/project
- run: yarn test && npx codecov

deploy:
branches:
only:
- master

docker:
- image: circleci/node:latest

working_directory: ~/repo

<<: *defaults
steps:
# deploy
- attach_workspace:
at: ~/project
- add_ssh_keys:
fingerprints:
- "f4:67:c7:78:7e:41:42:dd:ef:24:63:eb:67:66:14:c0"

- f4:67:c7:78:7e:41:42:dd:ef:24:63:eb:67:66:14:c0
- run: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run: yarn deploy

workflows:
version: 2
install-and-test:
jobs:
- install
- test:
requires:
- install

install-and-deploy:
jobs:
- install
- deploy:
requires:
- install
filters:
branches:
only: master
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"deploy": "yarn docs:build && gh-pages -u \"BuptStEve <[email protected]>\" -m \"[ci skip]\" -d docs/.vuepress/dist",
"next:pm": "npm --no-git-tag-version version preminor",
"next:pr": "npm --no-git-tag-version version prerelease",
"pub": "npm run build && npm publish",
"pub:n": "npm run build && npm publish --tag next"
"pub": "npm publish",
"pub:n": "npm publish --tag next"
},
"husky": {
"hooks": {
Expand Down

0 comments on commit eb06a4c

Please sign in to comment.