Deploy AI agents to production with a single git push
— this project demonstrates true continuous deployment for AWS Bedrock AgentCore agents using GitHub Actions.
Every commit to main
automatically:
- 🚀 Deploys a new version of each agent to AWS Bedrock
- 🏗️ Builds and pushes Docker images to Amazon ECR
- 📦 Tracks deployment history via timestamped artifacts
- ⚡ Runs in parallel for multi-agent deployments
No manual intervention required. Push your code, and your agents are live in minutes.
Each push to main
triggers a full deployment cycle:
git push origin main
↓
GitHub Actions detects the push
↓
Workflow extracts all agents from .bedrock_agentcore.yaml
↓
Parallel deployment begins for each agent
↓
Docker image built → pushed to ECR → deployed to Bedrock
↓
New version is live! ✨
The deployment triggers on:
- Direct pushes to the
main
branch - Merged pull requests to
main
The GitHub Actions workflow (.github/workflows/deploy-agent.yml) uses a matrix strategy to deploy multiple agents efficiently:
Setup Job:
- Extracts all agent names from
.bedrock_agentcore.yaml
usingyq
- Installs Python and
uv
package manager - Installs dependencies once (
uv sync
) - Caches the environment for reuse
Deploy Jobs (parallel):
- Restores the cached environment
- Configures AWS credentials
- Runs
agentcore launch --agent {agent-name}
for each agent - Saves agent-specific
.bedrock_agentcore.yaml
as an artifact
This approach eliminates redundant dependency installation, significantly speeding up multi-agent deployments.
You need to configure AWS authentication for GitHub Actions. Two options:
Option 1: OIDC (Recommended)
-
Create an IAM OIDC identity provider for GitHub Actions:
Provider URL: https://token.actions.githubusercontent.com Audience: sts.amazonaws.com
-
Create an IAM role with trust policy:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::YOUR_ACCOUNT:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com", "token.actions.githubusercontent.com:sub": "repo:YOUR_ORG/YOUR_REPO:ref:refs/heads/main" } } } ] }
-
Attach necessary permissions to the role:
- Amazon ECR (push images)
- AWS CodeBuild (trigger builds)
- Amazon Bedrock AgentCore (deploy agent)
-
Add the role ARN as a GitHub secret:
AWS_ROLE_ARN
Option 2: Access Keys
- Create an IAM user with programmatic access
- Attach necessary permissions (same as above)
- Add GitHub secrets:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
To deploy a specific agent:
uv sync
uv run agentcore launch --agent <agent-name>
- Python 3.12+
- uv package manager
- AWS credentials configured
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
# Run the agent locally (if applicable)
uv run python agent.py
You can invoke the agent locally for testing:
curl -X POST http://localhost:8080/invocations \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello!"}'
Adding a new agent is simple and automatically deployed:
# Configure a new agent interactively
uv run agentcore configure --agent <new-agent-name>
# Commit and push
git add .bedrock_agentcore.yaml
git commit -m "Add new agent"
git push origin main
What happens next:
- Configure command updates
.bedrock_agentcore.yaml
with your new agent - Push to
main
triggers the deployment workflow - Workflow automatically detects the new agent
- New agent is built and deployed alongside existing agents in parallel
- Your new agent is live! 🎉
Example:
# Add a new agent called "summarizer_agent"
uv run agentcore configure --entrypoint summarizer_agent.py
# Commit and push to deploy
git add .bedrock_agentcore.yaml
git commit -m "Add summarizer agent"
git push origin main
# ✅ Agent automatically deployed to AWS Bedrock
agent.py
- Agent entrypoint.bedrock_agentcore.yaml
- Agent configurationDockerfile
- Container definition.github/workflows/deploy-agent.yml
- Deployment workflow
Every deployment is tracked and versioned automatically:
Each successful deployment creates timestamped artifacts:
- Naming:
bedrock-agentcore-config-{agent-name}-{commit-sha}
- Retention: 90 days
- Purpose: Full audit trail of deployments and configuration changes
- Each
git push
tomain
creates a new agent version in AWS Bedrock - Docker images are tagged with the commit SHA for traceability
- Deployment artifacts link code changes to production versions
This means you can:
- 📜 Review deployment history across all agents
- 🔍 Trace production issues back to specific commits
- ⏮️ Roll back to any previous configuration
- 📊 Audit who deployed what and when