GitHub action to automate redeployment of ECS container in staging #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |