-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.55 KB
/
deploy.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
56
57
name: Deploy
on:
workflow_run:
workflows: [ Build ]
types: [ completed ]
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy-ecs:
concurrency:
group: delpoy
cancel-in-progress: true
runs-on: ubuntu-latest
environment: aws
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
#
- name: Read project.version
id: version_file
uses: juliangruber/read-file-action@v1
with:
path: ./core/assets/project.version
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWSACCESSKEYID }}
aws-secret-access-key: ${{ secrets.AWSSECRETKEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- 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: game-server-task.json
container-name: game-container
image: "${{ steps.login-ecr.outputs.registry }}/game:${{ steps.version_file.outputs.content }}"
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
cluster: game-cluster