-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (47 loc) · 1.66 KB
/
test-push-api-ecs.yml
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
45
46
47
48
49
50
51
52
53
54
55
on:
push:
branches: [test]
paths:
- "api/**"
name: <test> Deploy to Amazon ECS - "api"
jobs:
deploy:
name: Test 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: TS Build
run: |
cd api
yarn
yarn build
cd -
- name: Build, tag, and push image to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@2.14
with:
workdir: api
name: ${{ secrets.DOCKER_USERNAME }}/onad_web_api
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "${{ github.sha }},latest"
- 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: api/test-task-definition.json
container-name: TEST-onad-web-api
image: ${{ secrets.DOCKER_USERNAME }}/onad_web_api:${{ github.sha }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ secrets.ECS_SERVICE_NAME_API_SERVER_TEST }}
cluster: ${{ secrets.ECS_CLUSTER_NAME_TEST }}
wait-for-service-stability: true