Skip to content

Deploy

Deploy #304

Workflow file for this run

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