-
Notifications
You must be signed in to change notification settings - Fork 4
/
circle.yml
74 lines (70 loc) · 2.3 KB
/
circle.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
version: 2
jobs:
test-api:
docker:
- image: circleci/node:10
steps:
- checkout
- run: |
cd functions
npm install
- run: |
cd functions
npm run test
- store_artifacts:
path: functions/.coverage
test-ui:
docker:
- image: cypress/base:10
steps:
- checkout
- run: |
cd hosting
npm install
- run: |
cd hosting
npm run test
- store_artifacts:
path: hosting/test/videos
- store_artifacts:
path: hosting/test/screenshots
deploy:
docker:
- image: cypress/base:10
steps:
- checkout
- run: npm install
- run: |
cd hosting
npm install
- run: |
cd functions
npm install
- run: sed -i 's|{{ FIREBASE_API_KEY }}|'${FIREBASE_API_KEY}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ APP_ID }}|'${APP_ID}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ AUTH_DOMAIN }}|'${AUTH_DOMAIN}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ DATABASE_URL }}|'${DATABASE_URL}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ GOOGLE_ANALYTICS_CODE }}|'${GOOGLE_ANALYTICS_CODE}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ MESSAGE_SENDER_ID }}|'${MESSAGE_SENDER_ID}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ PROJECT_ID }}|'${PROJECT_ID}'|g' hosting/src/environments/environment.prod.ts
- run: sed -i 's|{{ STORAGE_BUCKET }}|'${STORAGE_BUCKET}'|g' hosting/src/environments/environment.prod.ts
- run: |
cd hosting
npm run build:prod
- run: npx firebase functions:config:set google.places_key=$GOOGLE_MAPS_SECRET_KEY --token $FIREBASE_KEY
- run: npx firebase functions:config:set sendgrid.api_key=$SENDGRID_API_KEY --token $FIREBASE_KEY
- run: npx firebase deploy --project codemortals-website --token $FIREBASE_KEY
workflows:
version: 2
build-deploy:
jobs:
- test-api
- test-ui
- deploy:
context: website-production
requires:
- test-api
- test-ui
filters:
branches:
only: master