forked from Shyam-Chen/Express-Starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcircle.yml
More file actions
41 lines (32 loc) · 1.22 KB
/
circle.yml
File metadata and controls
41 lines (32 loc) · 1.22 KB
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
version: 2
jobs:
build:
docker:
- image: circleci/node:8
working_directory: ~/Backend-Starter-Kit
steps:
- checkout
- setup_remote_docker
- run:
name: Start up containers
command: docker-compose up -d
- run:
name: Build the application
command: docker-compose exec api yarn build
- run:
name: Test the application
command: |
docker-compose exec api yarn test
docker-compose exec api yarn codecov --token=${CODECOV_TOKEN}
- run:
name: Deploy the application
command: |
if [ "${CIRCLE_BRANCH}" == "develop" ]; then
docker login -u="Shyam Chen" -p="${HEROKU_TOKEN}" registry.heroku.com
docker build -f ./tools/dev.Dockerfile -t registry.heroku.com/web-go-demo/web .
docker push registry.heroku.com/web-go-demo/web
elif [ "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u="Shyam Chen" -p="${HEROKU_TOKEN}" registry.heroku.com
docker build -f ./tools/prod.Dockerfile -t registry.heroku.com/web-go-demo/web .
docker push registry.heroku.com/web-go-demo/web
fi