Skip to content

Deploy container to AWS ECS #12

Deploy container to AWS ECS

Deploy container to AWS ECS #12

name: "Deploy container to AWS ECS"
on:
pull_request:
types: [closed]
branches: [main]
workflow_run:
workflows: ["Build and Publish Docker image"]
types:
- completed
jobs:
deploy-to-ecs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Deploy to ECS
run: |
aws ecs update-service --cluster ${{ secrets.ECS_CLUSTER }} --service ${{ secrets.ECS_SERVICE }} --force-new-deployment