How to Use a Larger Runner for Heavy Builds in GitHub Actions
Pointing runs-on at a larger runner label gives a CPU-bound job more cores so compile and bundle steps finish faster.
Define a larger runner in your org or repo runner settings, then set runs-on: to its label. Compile-heavy jobs scale roughly with the extra cores.
Steps
- Create a larger runner label in repository or org settings.
- Point the heavy job at it with
runs-on: <label>. - Keep light jobs on
ubuntu-latestso you only pay for size where it helps.
Workflow
.github/workflows/ci.yml
jobs:
build:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run build # CPU-bound bundle scales with coresGotchas
- Larger runners bill at a higher per-minute rate, so they pay off only when the job is genuinely CPU-bound.
- I/O-bound or network-bound jobs see little gain from more cores; profile before upsizing.
- Latchkey managed runners offer larger sizes without queue waits and auto-retry transient failures.
Related guides
How to Parallelize Lint, Test, and Build in GitHub ActionsRun lint, test, and build as separate jobs that start at the same time in GitHub Actions, so the slowest job…
How to Fail Fast to Cut Wasted Minutes in GitHub ActionsStop a matrix the moment one leg fails with strategy.fail-fast, and order quick checks before slow ones so a…