Skip to content

Commit d9c2260

Browse files
author
Pooya Parsa
committed
🥂 CircleCI 2
1 parent 292a384 commit d9c2260

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

‎.circleci/config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: /usr/src/app
5+
docker:
6+
- image: banian/node
7+
steps:
8+
# Checkout repository
9+
- checkout
10+
11+
# Restore cache
12+
- restore_cache:
13+
key: yarn-{{ checksum "yarn.lock" }}
14+
15+
# Install dependencies
16+
- run:
17+
name: Install Dependencies
18+
command: yarn
19+
20+
# Keep cache
21+
- save_cache:
22+
key: yarn-{{ checksum "yarn.lock" }}
23+
paths:
24+
- node_modules
25+
26+
# Deploy to NPM
27+
- deploy:
28+
command: |
29+
if [[ ${CIRCLE_COMMIT} =~ v[0-9]+(\.[0-9]+)* ]]; then
30+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
31+
npm publish
32+
fi

0 commit comments

Comments
 (0)