BM: Baca dalam Bahasa Melayu
World 7: Robots: Actions & CI/CD · Boss challenge
Auto-deploy the diary site
You will learn: to build, debug and trust a robot that deploys on every merge.
The problem
- Mmei
Day 5: I learned GitHub Actions.
- You merged this (Squash and merge).
Day 5 is merged. But the live diary still shows day 4. You deploy by hand, and you forgot. Boss mission: every merge deploys by itself.
Watch
Tap each point on the timeline.
Here is the plan. Tap each stop. Then build it, debug it, and explain it. Kind hints help if you get stuck.
Try it
Room 1: build the robot. Deploy on every push to main, but only after the tests pass.
Tap blocks to add them. Put them in order.
Blocks
Your workflow
Tap a block above to start.
Workflow file .github/workflows/
name: Deploy diary
What runs
Nothing to run yet.
Hint
When, token power, where, then steps. Test, then build, then deploy.Try it
Room 2: the first real run is red! Find the step that failed.
Hint
Look for the ✗. Tap it to read its log.Check
Room 3: the tests failed, and the live site stayed safe. Why must deploy come after the tests?
Pick one answer.
You did it!
You can now auto-deploy a site, safely, on every merge.
Go deeper (optional)
This course deploys the same way. Its deploy job has needs: check and only runs on pushes to main. Make it real (optional). Turn on GitHub Pages for your diary repo. Set its source to GitHub Actions. Pick the static HTML starter workflow. Then check here.
Check it on GitHub
- A workflow ran in your diary repoNot checked yet
- GitHub Pages is onNot checked yet
Bahasa Melayu
Hari 5 dah di-merge. Tapi diari yang live masih tunjuk hari 4. Anda deploy dengan tangan, dan anda terlupa. Misi boss: setiap merge deploy dengan sendirinya.
Ini rancangannya. Ketik setiap hentian. Kemudian bina, debug, dan terangkan. Petunjuk mesra akan bantu kalau anda buntu.
Bilik 1: bina robot itu. Deploy pada setiap push ke main, tapi hanya selepas ujian lulus.
Bilik 2: larian sebenar yang pertama berwarna merah! Cari langkah yang gagal.
Bilik 3: ujian gagal, dan laman yang live kekal selamat. Kenapa deploy mesti datang selepas ujian?
Kini anda boleh auto-deploy laman dengan selamat, setiap kali merge.
You finished this before. Practice is always welcome!
Official docs: Workflow syntax · Using secrets in GitHub Actions · Cloudflare Workers: GitHub Actions · Using custom workflows with GitHub Pages
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?