This repository was archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathcircle.yml
More file actions
50 lines (47 loc) · 1.44 KB
/
circle.yml
File metadata and controls
50 lines (47 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
version: 2
jobs:
build:
docker:
- image: circleci/node:6
steps:
- checkout
- restore_cache:
key: cache-{{ checksum "package-lock.json" }}
- run: make node_modules
- save_cache:
key: cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
publish:
docker:
- image: circleci/node:6
steps:
- setup_remote_docker
- checkout
- restore_cache:
key: cache-{{ checksum "package-lock.json" }}
- run:
name: Authenticate with AWS and Docker
command: |
sudo apt-get update && sudo apt-get install -y python-dev
curl -O https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
sudo pip install awscli==1.11.91
aws ecr get-login --no-include-email --region $AWS_REGION | sh
docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Build and Publish Docker Images
command: |
docker build -t segment/specs .
docker push segment/specs:latest
docker tag segment/specs:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/specs:latest
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/specs:latest
workflows:
version: 2
build-and-publish:
jobs:
- build
- publish:
filters:
branches:
only:
- master