Skip to content

ci: add on-demand workflow to redeploy the ECS service - #154

Merged
AdamBelfki3 merged 1 commit into
mainfrom
ecs-deploy-workflow
Oct 29, 2026
Merged

AdamBelfki3 merged 1 commit into
mainfrom
ecs-deploy-workflow

Conversation

@AdamBelfki3

Copy link
Copy Markdown
Member

Summary

Adds a manually triggered Deploy to ECS workflow (.github/workflows/deploy-ecs.yml) that redeploys the ECS service running the image main.yml builds and pushes to ECR. Today a new image only reaches ECS if someone restarts the service by hand.

  • Forces a new deployment of the service. The task definition references the latest tag, which ECS resolves to a digest at the start of each deployment, so the newest push gets picked up.
  • Tracks that deployment's rolloutState until it is COMPLETED, FAILED, or no longer listed (rolled back or superseded), with a 20-minute timeout. aws ecs wait services-stable isn't used because it also succeeds once a circuit-breaker rollback settles on the previous image.
  • Writes the cluster, service, deployment id and task definition to the job summary.
  • One deployment at a time: a second run queues instead of cancelling the one in flight.

The build workflow is unchanged. workflow_call can be added later if main.yml should deploy automatically after pushing.

Setup before the first run

  • Repo variables ECS_CLUSTER and ECS_SERVICE (the cluster name and the service name from the ECS console). The workflow fails early if either is missing.
  • The AWS_IAM_ROLE role needs ecs:UpdateService and ecs:DescribeServices on the service.
  • If the service runs one task on a single instance with a fixed host port, set its deployment configuration to minimum healthy 0% / maximum 100%. Otherwise the new task can't be placed while the old one holds the port, and the deployment times out.
  • Optionally, turn on the ECS deployment circuit breaker with rollback so a bad image reverts on its own; this workflow then reports the failure.

Testing

  • actionlint (with shellcheck) passes on the new workflow.
  • The deployment-tracking JMESPath queries were checked against mock describe-services responses for in-progress, completed, failed and rolled-back deployments.
  • Not run against AWS yet: a workflow_dispatch workflow can only be triggered once it is on the default branch.

🤖 Generated with Claude Code

Adds a manually triggered "Deploy to ECS" workflow that forces a new
deployment of the service running the image built by main.yml, then
tracks that deployment's rolloutState until it completes, fails, or is
rolled back. Reads the cluster and service from the ECS_CLUSTER and
ECS_SERVICE repo variables and reuses the AWS_IAM_ROLE secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
workbench Ready Ready Preview Oct 29, 2026 6:37pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdamBelfki3
AdamBelfki3 merged commit 7c98a18 into main Oct 29, 2026
5 of 7 checks passed
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview deployed

@argos-ci

argos-ci Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 13 removed Oct 29, 2026, 6:45 PM

This branch was successfully deployed

1 active deployment
Preview — 52b4cec6 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant