BM: Baca dalam Bahasa Melayu
World C3: Release & Deploy
Environments with required reviewers
You will learn: how to make production wait for a person to say yes.
Checked with GitHub Actions 2026-10 on 31 Oct 2026
The problem
Pick an event. Press Run and watch the line.
Midnight: a push to main tests, then deploys at once.
Workflow file .github/workflows/deploy.yml
name: Deploy on: push: branches: [main] permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: npm ci - run: npm test deploy: needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: npm ci - run: npm run deploy env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
The line
Push to main · main
Midnight. A teammate pushes to main. The van leaves at once. Nobody tasted the food. Run it and watch.
Watch
Give production a guard. An environment: A named place you deploy to, like production, with its own secrets and rules. is a named place you deploy to. It has its own rules. Which of these are environment rules?
Drag a card into a box. Or tap the card, then tap the box.
Try it
Production now has a required reviewer: A person who must approve before a job deploys to an environment, like the head chef signing before the van leaves.: Aina. Run it. The deploy job waits. You are Aina: check it, then approve.
Run it. When a job waits for you, check it and approve.
Workflow file .github/workflows/deploy.yml
name: Deploy on: push permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: npm ci - run: npm test deploy: needs: test runs-on: ubuntu-latest environment: name: production url: https://shop.example.com steps: - uses: actions/checkout@v7 - run: npm ci - run: npm run deploy env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
The line
Push to main · main
Hint
Press Run. When the deploy station waits, press the approve button.Try it
Now build it. A job joins an environment with one key: environment.
Tap blocks to add them. Put them in order.
Blocks
Your workflow
Tap a block above to start.
Workflow file .github/workflows/
name: Deploy
What runs
Nothing to run yet.
Hint
Trigger, permissions, the job with an environment, then the steps.Predict
Someone pushes to the branch feature. Production allows only main. What happens to the deploy job?
Pick one answer.
Check
Check it on the belt. Find the push the guard stops. Read the real message.
Try the events. Find the one asked for.
Workflow file .github/workflows/deploy.yml
name: Deploy on: push permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: npm ci - run: npm test deploy: needs: test runs-on: ubuntu-latest environment: name: production url: https://shop.example.com steps: - uses: actions/checkout@v7 - run: npm ci - run: npm run deploy env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
The line
Push to main · main
Hint
Try the push to the feature branch.You did it!
You can now put a human gate in front of production.
Go deeper (optional)
Up to six people or teams can be reviewers. One approval is enough. Turn on “prevent self-review” so nobody approves their own deploy. A wait timer can pause up to 30 days. On private repos, required reviewers need GitHub Enterprise.
Real rep (optional): in a public test repo, make a production environment. Add yourself as its reviewer.
Bahasa Melayu
Tengah malam. Rakan sepasukan push ke main. Van terus bertolak. Tiada siapa rasa makanan itu. Run dan perhati.
Beri production seorang pengawal. Environment (persekitaran) ialah tempat bernama untuk deploy, dengan peraturan sendiri. Yang mana peraturan environment?
Production kini ada penyemak wajib: Aina. Run. Job deploy menunggu. Anda ialah Aina: semak, kemudian luluskan.
Sekarang bina sendiri. Job masuk ke environment dengan satu kunci: environment.
Seseorang push ke branch feature. Production hanya benarkan main. Apa jadi pada job deploy?
Semak pada tali sawat. Cari push yang ditahan pengawal. Baca mesej sebenar.
Kini anda boleh letak pintu manusia di depan production.
You finished this before. Practice is always welcome!
Official docs: Deployments and environments · Reviewing deployments
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?