-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.43 KB
/
push-ecs.yml
File metadata and controls
44 lines (37 loc) · 1.43 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
on:
push:
branches: [master]
name: Deploy to Amazon ECS - "Creator Detail"
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
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: Build, tag, and push image to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@2.14
with:
name: ${{ secrets.DOCKER_USERNAME }}/creatordetail
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: ${{ github.sha }}
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: onad-creatordetail
image: ${{ secrets.DOCKER_USERNAME }}/creatordetail:${{ github.sha }}
- name: Deploy Amazon ECS task definition
uses: airfordable/ecs-deploy-task-definition-to-scheduled-task@v2.0.0
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
cluster: ${{ secrets.AWS_ECS_CLUSTER }}
wait-for-service-stability: true