BM: Baca dalam Bahasa Melayu
World C2: Container Pipelines
Concurrency, path filters and caching
You will learn: three tricks that make the belt faster and cheaper.
Checked with GitHub Actions 2026-10 on 31 Oct 2026
The problem
You push 3 small fixes in 2 minutes. The belt runs all 3 in full. Only the last one matters. What would help?
Pick one answer.
Watch
Pick an event. Press Run and watch the line.
A push to menu-page starts a run. An older run on the same branch is cancelled first. Then the tests run and pass.
Workflow file .github/workflows/ci.yml
name: CI on: push: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 24 cache: npm - run: npm ci - run: npm test
The line
Push to menu-page · menu-page
concurrency: Runs in the same group wait their turn, or the older one is cancelled. puts runs in a group: same workflow, same branch. cancel-in-progress: true cancels the older run. Press Run.
Check
You push to main and to menu-page at the same time. Does one cancel the other?
Pick one answer.
Try it
A path filter: paths or paths-ignore: start the workflow only when certain files change. skips the belt when only some files change. This one says paths-ignore: ['docs/**', '**.md']. Sort each push.
Drag a card into a box. Or tap the card, then tap the box.
Try it
cache: npm keeps npm’s downloads in the pantry between runs. Press Run twice. The second npm ci is quicker.
Run it twice. Watch the second run take a shortcut.
Workflow file .github/workflows/ci.yml
name: CI on: push: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 24 cache: npm - run: npm ci - run: npm test
The line
Push to menu-page · menu-page
Predict
A PR changes only README.md. Its required CI check uses this path filter. Can you merge?
Pick one answer.
You did it!
You can now make the belt skip, cancel and reuse work.
Go deeper (optional)
Don’t cancel a deploy halfway: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} keeps main safe. Path filters are not checked for tag pushes. Caches nobody uses for a while are deleted.
Real rep (optional), in a public practice repo:
Real mission
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Anda push 3 pembaikan kecil dalam 2 minit. Tali sawat jalankan ketiga-tiganya sepenuhnya. Hanya yang terakhir penting. Apa yang boleh bantu?
Concurrency letak run dalam satu kumpulan: workflow sama, branch sama. cancel-in-progress: true batalkan run yang lama. Tekan Run.
Anda push ke main dan ke menu-page serentak. Adakah satu batalkan yang lain?
Penapis laluan langkau tali sawat bila hanya fail tertentu berubah. Yang ini tulis paths-ignore: ['docs/**', '**.md']. Susun setiap push.
cache: npm simpan muat turun npm dalam pantri antara run. Tekan Run dua kali. npm ci kedua lebih cepat.
Satu PR ubah README.md sahaja. Semakan CI wajibnya guna penapis laluan ini. Boleh anda merge?
Kini anda boleh buat tali sawat langkau, batal dan guna semula kerja.
You finished this before. Practice is always welcome!
Official docs: Control the concurrency of workflows and jobs · Workflow syntax: paths and paths-ignore · Dependency caching
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?