World map

 

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.

What happened on GitHub

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.

      What happened on GitHub

      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.