BM: Baca dalam Bahasa Melayu
World C3: Release & Deploy · Boss challenge
Bad Friday
You will learn: to ship a canary, spot the error spike, and roll back before most users notice.
Checked with GitHub Actions 2026-10 on 31 Oct 2026
The problem
Friday, 4:55 pm. Version 2.3.0 of the shop is tagged. Your lead is on a plane, and you are on call. Boss mission: ship it safely, or undo it fast. How do you ship it?
Pick one answer.
Try it
Room 1: the tag starts the canary workflow. It sends 5% of users to version 2.3.0, then tastes /health. Run it.
Pick an event. Press Run and watch the line.
The tag v2.3.0 deploys the canary to 5% of users, then a smoke test checks /health.
Workflow file .github/workflows/canary.yml
name: Canary on: push: tags: ['v*'] permissions: contents: read jobs: canary: runs-on: ubuntu-latest environment: production steps: - uses: actions/checkout@v7 - run: npm ci - run: npm run deploy:canary env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - run: curl --fail --silent https://shop.example.com/health
The line
Push tag v2.3.0 · v2.3.0
Hint
Pick the tag, then press Run.Try it
Room 2: the canary is live at 5%. Watch the graph. Move up only while the version 2 line stays calm. Roll back before 150 users hit a bug.
Send a few users to v2. Watch the graph. Roll back if errors jump.
Users now: 100% on v1 (old), 0% on v2 (new).
v1 (old) v2 (new)
Minute 0
Users who hit a v2 error: 0 (limit 150)
Numbers, minute by minute
No traffic yet.
Hint
The red line jumps over the alarm line? Press Roll back at once.Check
The smoke test passed, yet users hit errors. Why?
Pick one answer.
Try it
Room 3: make the undo stick. The rollback workflow, run by hand, is red. Read the real error. Fix the yellow line.
The line is red. Fix the yellow lines, then run again.
Workflow file .github/workflows/rollback.yml
name: Rollback on: workflow_dispatch: permissions: contents: read jobs: rollback: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: npm ci - run: npx wrangler rollback --message "Bad Friday" env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - run: curl --fail --silent https://shop.example.com/health
Yellow: lines 8–8. You can change these.
The line
Run by hand · main
Hint
Remember lesson 7: secrets reach only jobs that name their environment.Check
Write the plan for next time. Put what the pipeline does in order.
First step at the top. Put these in order. Use the arrows, or drag.
- One alert opens, with a link to the run
- A smoke test tastes /health and checkout
- Errors jump: the rollback job runs
- A tag sends the canary to 5% of users
- Watch the error rate for 15 minutes
You did it!
You can now ship on a Friday and undo it in minutes.
Go deeper (optional)
On Cloudflare, a canary is a gradual deployment. These commands do it by hand. Wrangler prints each version id when you upload.
Real rep (optional): practise on a free test Worker, never on your team’s.
Bahasa Melayu
Jumaat, 4:55 petang. Versi 2.3.0 kedai dah ditag. Ketua anda dalam kapal terbang, dan anda bertugas. Misi bos: hantar dengan selamat, atau undur dengan pantas. Macam mana anda hantar?
Bilik 1: tag itu mulakan workflow canary. Ia hantar 5% pengguna ke versi 2.3.0, kemudian rasa /health. Run.
Bilik 2: canary dah live pada 5%. Perhati graf. Naik hanya bila garis versi 2 tenang. Rollback sebelum 150 pengguna kena bug.
Smoke test lulus, tapi pengguna kena ralat. Kenapa?
Bilik 3: kekalkan undur itu. Workflow rollback, yang dijalankan secara manual, jadi merah. Baca ralat sebenar. Baiki baris kuning.
Tulis pelan untuk lain kali. Susun apa yang pipeline buat.
Kini anda boleh hantar pada hari Jumaat dan undur dalam beberapa minit.
You finished this before. Practice is always welcome!
Official docs: Cloudflare: gradual deployments · Cloudflare: rollbacks · Deployments and environments
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?