forked from blocknative/web3-onboard
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.yml
77 lines (77 loc) · 2.88 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: 2
jobs:
test:
docker:
- image: circleci/node:8.15-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: yarn
- run: yarn test
- run: yarn build
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
deploy_stage:
docker:
- image: circleci/node:8.15-browsers
user: root
steps:
- checkout
- run: sudo apt update && sudo apt install awscli
- run: yarn
- run: yarn build
- run: sudo npm i -g npm-cli-login
- run: NPM_USER=$NPM_USERNAME NPM_EMAIL=$NPM_EMAIL NPM_PASS=$NPM_PASSWORD npm-cli-login
- run: npm publish --dry-run
- run: gzip -9 ./dist/bnc-onboard.js
- run: mv ./dist/bnc-onboard.js.gz ./dist/bnc-onboard.js
- run: ls -al
- run: echo export VERSION=`awk '/version/{gsub(/("|",)/,"",$2);print $2};' package.json | sed 's/\./-/g'` >> $BASH_ENV
- run: mkdir /root/project/deploy-temp
- run: mkdir /root/project/deploy-temp/${VERSION}
- run: mv /root/project/dist/*.js /root/project/deploy-temp/${VERSION}/
- run: aws s3 sync /root/project/deploy-temp/${VERSION}/ s3://staging.onboard.blocknative.com/${VERSION}/ --content-type "text/javascript" --content-encoding "gzip" --cache-control "max-age=31536000" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
deploy_prod:
docker:
- image: circleci/node:8.15-browsers
user: root
steps:
- checkout
- run: sudo apt update && sudo apt install awscli
- run: yarn
- run: yarn build
- run: sudo npm i -g add npm-cli-login
- run: NPM_USER=$NPM_USERNAME NPM_EMAIL=$NPM_EMAIL NPM_PASS=$NPM_PASSWORD npm-cli-login
- run: npm publish
- run: gzip -9 ./dist/bnc-onboard.js
- run: mv ./dist/bnc-onboard.js.gz ./dist/bnc-onboard.js
- run: ls -al
- run: echo export VERSION=`awk '/version/{gsub(/("|",)/,"",$2);print $2};' package.json | sed 's/\./-/g'` >> $BASH_ENV
- run: mkdir /root/project/deploy-temp
- run: mkdir /root/project/deploy-temp/${VERSION}
- run: mv /root/project/dist/*.js /root/project/deploy-temp/${VERSION}/
- run: aws s3 sync /root/project/deploy-temp/${VERSION}/ s3://onboard.blocknative.com/${VERSION}/ --content-type "text/javascript" --content-encoding "gzip" --cache-control "max-age=31536000" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
workflows:
version: 2
test_build:
jobs:
- test
- deploy_stage:
requires:
- test
filters:
branches:
only:
- develop
- deploy_prod:
requires:
- test
filters:
branches:
only:
- master