Skip to content

Commit

Permalink
Feat CI pipeline (#21)
Browse files Browse the repository at this point in the history
* Add CD Pipeline using Github Actions (#7)

* Test commit

* Test Commit remove commit status cehck

* v1

* test2

* test3

* test4

* test deploying task definition

* test deploy ecs Task Definition

* test deploying ecs task definition

* test deploy

* test

* test

* test

* ecs

* test

* test

* Update to use ci.yaml

* Fix env

---------

Co-authored-by: eu2525 <[email protected]>
  • Loading branch information
mokhs00 and eu2525 authored Dec 6, 2024
1 parent 9339517 commit 0c0ad29
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ci

on:
- push

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build and push container image
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/dittodining:${{ github.sha }}
# private repo로 전환한다면 아래와 같이 GitHub access token이 필요
# build-args: |
# GH_ACCESS_TOKEN=${{ secrets.GH_ACCESS_TOKEN }}
55 changes: 55 additions & 0 deletions task-definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"containerDefinitions": [
{
"name": "dittodining",
"image": "954976319012.dkr.ecr.ap-northeast-2.amazonaws.com/dittodining:latest",
"cpu": 0,
"portMappings": [
{
"name": "server",
"containerPort": 8080,
"hostPort": 8080,
"protocol": "tcp",
"appProtocol": "http"
},
{
"name": "database",
"containerPort": 3306,
"hostPort": 3306,
"protocol": "tcp",
"appProtocol": "http"
}
],
"essential": true,
"environment": [],
"mountPoints": [],
"volumesFrom": [],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/dittodining",
"mode": "non-blocking",
"awslogs-create-group": "true",
"max-buffer-size": "25m",
"awslogs-region": "ap-northeast-2",
"awslogs-stream-prefix": "ecs"
}
},
"systemControls": []
}
],
"family": "dittodining",
"networkMode": "awsvpc",
"volumes": [],
"placementConstraints": [],
"requiresCompatibilities": [
"EC2"
],
"cpu": 256,
"memory": 256,
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
},
"tags": []
}

0 comments on commit 0c0ad29

Please sign in to comment.