BM: Baca dalam Bahasa Melayu
World A4: Containers in the Cloud
Deploy from GitHub Actions with OIDC
You will learn: to push Kedai Kancil's image to ECR and roll it out on ECS from GitHub Actions, with no stored AWS keys.
Checked with AWS 2026-11 on 1 Nov 2026
The problem
Your workflow must push a new image to ECR and update the ECS service. It needs AWS keys. Which ones?
Pick one answer.
Watch
This is OIDC (OpenID Connect): The runner shows a visitor badge for one job. The cloud checks it and lends a key that expires when the job ends., as in CI/CD World C3, now aimed at AWS. Put one deploy in order.
First step at the top. Put these in order. Use the arrows, or drag.
- AWS lends short-lived role keys
- AWS checks the repo and environment
- The job asks GitHub for an ID token
- The job pushes the image to ECR
- ECS rolls out new tasks
Watch
The role’s trust policy says which badges it accepts. Tap the line that allows only one repo and one environment.
Tap the line that limits who may borrow the role.
0 of 1 found
Try it
Build the deploy workflow. No stored keys.
Tap blocks to add them. Put them in order.
Blocks
Your workflow
Tap a block above to start.
Workflow file .github/workflows/
name: Deploy to ECS
What runs
Nothing to run yet.
Hint
Trigger, the badge permission, the job, then the steps in deploy order.Predict
Someone pushes to a test branch without the production environment. Their job asks for the role. What happens?
Pick one answer.
Check
The deploy role may update the service. Now a run tries to delete it. Will AWS allow it?
Read the request and its policies. Will AWS say Allow or Deny?
The request
- Who
- kedai-deploy (role session)
arn:aws:sts::111122223333:assumed-role/kedai-deploy/run-7 - Wants to
ecs:DeleteService- On
arn:aws:ecs:ap-southeast-5:111122223333:service/kedai/shop
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["ecs:UpdateService", "ecs:DescribeServices"], "Resource": "arn:aws:ecs:ap-southeast-5:111122223333:service/kedai/shop" } ]}You did it!
You can now deploy to ECS from GitHub Actions, with no stored keys.
Go deeper (optional)
The full role also needs ECR push rights, ecs:RegisterTaskDefinition and iam:PassRole for the task roles. GitHub’s guide pins the ECS steps to exact commits, as here. Newer repos may use another subject format. Copy the exact one from GitHub’s OIDC docs.
Bahasa Melayu
Workflow anda mesti push image baru ke ECR dan kemas kini service ECS. Ia perlukan kunci AWS. Yang mana?
Inilah OIDC, seperti dalam Dunia CI/CD C3, kini dihalakan ke AWS. Susun satu deploy.
Trust policy role itu sebut lencana mana yang ia terima. Ketik baris yang benarkan satu repo dan satu environment sahaja.
Bina workflow deploy. Tiada kunci disimpan.
Seseorang push ke branch ujian tanpa environment production. Job mereka minta role itu. Apa jadi?
Role deploy boleh kemas kini service. Kini satu run cuba padamnya. Adakah AWS benarkan?
Kini anda boleh deploy Kedai Kancil ke ECS dari GitHub Actions, tanpa kunci AWS disimpan.
You finished this before. Practice is always welcome!
Official docs: IAM: Create an OIDC identity provider · IAM: Role for web identity (OIDC) federation · GitHub: OpenID Connect in Amazon Web Services · GitHub: Deploy to Amazon ECS · aws-actions/configure-aws-credentials
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?