Skip to content

Commit d783078

Browse files
Merge pull request #9 from laironacosta/feature/deploy-to-aws-ecs
adding aws yml to deploy to ecs in aws
2 parents 91132a1 + d21e41f commit d783078

File tree

2 files changed

+123
-5
lines changed

2 files changed

+123
-5
lines changed

.github/workflows/aws.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ name: Deploy to Amazon ECS
3232
jobs:
3333
deploy:
3434
name: Deploy
35-
runs-on: ubuntu-latest
36-
environment: production
35+
runs-on: alpine-latest
36+
environment: develop
3737

3838
steps:
3939
- name: Checkout
@@ -54,7 +54,7 @@ jobs:
5454
id: build-image
5555
env:
5656
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
57-
ECR_REPOSITORY: my-ecr-repo
57+
ECR_REPOSITORY: dev-repos
5858
IMAGE_TAG: ${{ github.sha }}
5959
run: |
6060
# Build a docker container and
@@ -69,13 +69,13 @@ jobs:
6969
uses: aws-actions/amazon-ecs-render-task-definition@v1
7070
with:
7171
task-definition: task-definition.json
72-
container-name: sample-app
72+
container-name: alpine
7373
image: ${{ steps.build-image.outputs.image }}
7474

7575
- name: Deploy Amazon ECS task definition
7676
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
7777
with:
7878
task-definition: ${{ steps.task-def.outputs.task-definition }}
79-
service: sample-app-service
79+
service: alpine-service
8080
cluster: default
8181
wait-for-service-stability: true

task-definition.json

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"ipcMode": null,
3+
"executionRoleArn": "arn:aws:iam::027479467189:role/ecsTaskExecutionRole",
4+
"containerDefinitions": [
5+
{
6+
"dnsSearchDomains": null,
7+
"environmentFiles": null,
8+
"logConfiguration": {
9+
"logDriver": "awslogs",
10+
"secretOptions": null,
11+
"options": {
12+
"awslogs-group": "/ecs/ms-gin-go-task-definition",
13+
"awslogs-region": "us-east-2",
14+
"awslogs-stream-prefix": "ecs"
15+
}
16+
},
17+
"entryPoint": [],
18+
"portMappings": [
19+
{
20+
"hostPort": 80,
21+
"protocol": "tcp",
22+
"containerPort": 80
23+
}
24+
],
25+
"command": [],
26+
"linuxParameters": null,
27+
"cpu": 256,
28+
"environment": [],
29+
"resourceRequirements": null,
30+
"ulimits": null,
31+
"dnsServers": null,
32+
"mountPoints": [],
33+
"workingDirectory": null,
34+
"secrets": null,
35+
"dockerSecurityOptions": null,
36+
"memory": null,
37+
"memoryReservation": 512,
38+
"volumesFrom": [],
39+
"stopTimeout": null,
40+
"image": "alpine:latest",
41+
"startTimeout": null,
42+
"firelensConfiguration": null,
43+
"dependsOn": null,
44+
"disableNetworking": null,
45+
"interactive": null,
46+
"healthCheck": null,
47+
"essential": true,
48+
"links": [],
49+
"hostname": null,
50+
"extraHosts": null,
51+
"pseudoTerminal": null,
52+
"user": null,
53+
"readonlyRootFilesystem": null,
54+
"dockerLabels": null,
55+
"systemControls": null,
56+
"privileged": null,
57+
"name": "alpine"
58+
}
59+
],
60+
"placementConstraints": [],
61+
"memory": "512",
62+
"taskRoleArn": null,
63+
"compatibilities": [
64+
"EC2",
65+
"FARGATE"
66+
],
67+
"taskDefinitionArn": "arn:aws:ecs:us-east-2:027479467189:task-definition/ms-gin-go-task-definition:1",
68+
"family": "ms-gin-go-task-definition",
69+
"requiresAttributes": [
70+
{
71+
"targetId": null,
72+
"targetType": null,
73+
"value": null,
74+
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
75+
},
76+
{
77+
"targetId": null,
78+
"targetType": null,
79+
"value": null,
80+
"name": "ecs.capability.execution-role-awslogs"
81+
},
82+
{
83+
"targetId": null,
84+
"targetType": null,
85+
"value": null,
86+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
87+
},
88+
{
89+
"targetId": null,
90+
"targetType": null,
91+
"value": null,
92+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
93+
},
94+
{
95+
"targetId": null,
96+
"targetType": null,
97+
"value": null,
98+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
99+
},
100+
{
101+
"targetId": null,
102+
"targetType": null,
103+
"value": null,
104+
"name": "ecs.capability.task-eni"
105+
}
106+
],
107+
"pidMode": null,
108+
"requiresCompatibilities": [
109+
"FARGATE"
110+
],
111+
"networkMode": "awsvpc",
112+
"cpu": "256",
113+
"revision": 1,
114+
"status": "ACTIVE",
115+
"inferenceAccelerators": null,
116+
"proxyConfiguration": null,
117+
"volumes": []
118+
}

0 commit comments

Comments
 (0)