Skip to content

Commit 8f8f3ae

Browse files
authored
Merge pull request #203 from sparcs-kaist/#137.3-auto-taging-and-push-image
closes #137
2 parents 37debe0 + d68022b commit 8f8f3ae

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

.github/workflows/push_image_ecr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push Image to Amazon ECR
1+
name: Push Prod Image to Amazon ECR
22

33
# when tagging action success
44
on:
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Push Dev Image to Amazon ECR
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
branches:
7+
- dev
8+
9+
env:
10+
AWS_REGION: ap-northeast-2
11+
12+
jobs:
13+
if_merged:
14+
if: github.event.pull_request.merged == true
15+
name: Create Release and Tag
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Configure AWS credentials
25+
uses: aws-actions/configure-aws-credentials@v1
26+
with:
27+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
28+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29+
aws-region: ${{ env.AWS_REGION }}
30+
31+
- name: Login to AWS ECR
32+
id: login-ecr
33+
uses: aws-actions/amazon-ecr-login@v1
34+
35+
- name: Build and Push to AWS ECR
36+
id: build_image
37+
env:
38+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
39+
ECR_REPOSITORY: taxi-back
40+
run: |
41+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:dev .
42+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
43+
echo "Push iamge : $ECR_REGISTRY/$ECR_REPOSITORY:dev"

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ FROM node:16-alpine
44
WORKDIR /usr/src/app
55
COPY . .
66

7+
# Install curl (for taxi-docker)
8+
RUN apk update && apk add curl
9+
710
# Install requirements
811
RUN npm ci
912

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ See [contributors](https://github.com/sparcs-kaist/taxi-front/graphs/contributor
4444
- frontend : https://github.com/sparcs-kaist/taxi-front
4545
- backend : https://github.com/sparcs-kaist/taxi-back
4646
- app : https://github.com/sparcs-kaist/taxi-app
47+
- docker : https://github.com/sparcs-kaist/taxi-docker
4748
- figma : https://www.figma.com/file/li34hP1oStJAzLNjcG5KjN/SPARCS-Taxi?node-id=0%3A1
4849
- taxiSampleGenerator : https://github.com/sparcs-kaist/taxiSampleGenerator

0 commit comments

Comments
 (0)