Skip to content
Latchkey

Understanding and Cutting Your CI Bill

You cannot cut a bill you have not broken down, so start by finding where the minutes go.

CI spend is mostly billed minutes, and minutes hide in places teams rarely audit: redundant runs, oversized runners, and jobs that should have been skipped. This lesson breaks the bill into its drivers and gives concrete cuts, including a calculator to estimate the savings.

What drives the bill

  • Billed minutes: total job duration times the per-minute rate for the runner size.
  • Runner size multiplier: larger runners often bill at a higher per-minute rate.
  • Redundant runs: duplicate triggers, re-runs of unchanged jobs, and full-suite runs for trivial changes.
  • Storage and data transfer: artifacts and caches retained longer than needed.

Concrete cuts

  • Add concurrency with cancel-in-progress so a new push cancels the now-obsolete in-flight run.
  • Use paths filters so doc-only changes do not trigger the full build-and-test pipeline.
  • Right-size runners: do not pay for an 8-core machine for a job that is single-threaded.
  • Cache aggressively (previous lesson) so you stop paying to reinstall the same dependencies.
  • Shorten artifact and cache retention to cut storage charges.

Cancel superseded runs automatically

A concurrency group keyed per branch cancels older runs when a new commit lands, so you stop paying for work that no one is waiting on.

.github/workflows/ci.yml
concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

Estimate your savings

Before committing to changes, estimate the impact. Latchkey publishes a cost calculator at /learn/github-actions-cost-calculator where you plug in your monthly minutes and runner mix to see current spend and what a cheaper managed-runner rate would cost. It turns "we should optimize CI" into a concrete dollar figure you can act on.

Key takeaways

  • The bill is mostly billed minutes times runner rate; cut both the minutes and the size.
  • Cancel superseded runs, filter by paths, right-size runners, and cache to eliminate waste.
  • Use the cost calculator at /learn/github-actions-cost-calculator to quantify the savings first.

Related guides

See what you would save - Latchkey managed runners with self-healing. Start free →