-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} |