World map

 

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.

What happened on GitHub

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

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).

Error rate per minute
0%6%11%alarmminutes →

v1 (old) v2 (new)

Minute 0

Users who hit a v2 error: 0 (limit 150)

Numbers, minute by minute

No traffic yet.

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.

What happened on GitHub

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.

Pick a fix

The line

Run by hand · main

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.

bash
npx wrangler versions upload
npx wrangler versions deploy NEW_ID@5% OLD_ID@95%
npx wrangler rollback --message "Bad Friday"
Upload a version, send it 5% of traffic, then roll back to the previous version.

Real rep (optional): practise on a free test Worker, never on your team’s.