How to Decide Whether to Use Spot or Preemptible Runners
Spot and preemptible instances cost far less than on-demand but can be reclaimed with little notice, so use them for retryable jobs and keep releases on stable capacity.
Spot capacity is the cheapest way to run self-hosted runners, but the provider can take the machine back mid-job. That is fine for idempotent, retryable work and risky for long, non-resumable jobs.
Which jobs suit spot
| Job type | Spot-friendly? |
|---|---|
| Unit/integration tests (retryable) | Yes |
| Matrix legs (independent) | Yes |
| Long single-shot builds | Risky |
| Production deploys/releases | No, use stable capacity |
Make jobs interruption-tolerant
.github/workflows/ci.yml
jobs:
test:
runs-on: [self-hosted, spot]
timeout-minutes: 20 # cap so a reclaimed job fails fast and re-queues
steps:
- uses: actions/checkout@v4
- run: npm ci && npm testPlan for reclamation
Design jobs to be safely re-runnable, keep them short, and route anything that must not be interrupted to on-demand runners. Auto-retry of interrupted jobs (a feature of some managed runner services) softens the interruption risk.
Related guides
How to Choose Between Ephemeral and Persistent RunnersDecide whether self-hosted runners should be ephemeral (fresh per job) or persistent (reused), weighing isola…
How to Factor Queue Time Into Choosing a RunnerInclude time spent waiting for an available runner, not just run time, when choosing between hosted, larger,…