Skip to content

GitHub action to automate redeployment of ECS container in staging #2

GitHub action to automate redeployment of ECS container in staging

GitHub action to automate redeployment of ECS container in staging #2

name: Redeploy ECS container in STAGING
on:
push:
branches:
- staging_auto_redeploy
#on:
# workflow_run:
# workflows: ["Publish STAGING image"]
# types:
# - completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_STAGING_ECS_REDEPLOY_ROLE_ARN }}
aws-region: ${{ vars.AWS_STAGING_REGION }}
- name: Update ECS Service
run: |
aws ecs update-service \
--cluster ${{ vars.AWS_STAGING_ECS_CLUSTER }} \
--service ${{ vars.AWS_STAGING_ECS_SERVICE }} \
--force-new-deployment