CI artifact retention and split CI
GitHub Actions artifacts are downloadable files in GitHub cloud storage. They do not stay on the CI virtual machine, and they do not speed up later builds. Each job VM is wiped when the job ends. GitHub bills Actions storage by the gigabyte-hour and, unless retention-days is set, keeps artifacts for 90 days.
Build caches (actions/cache, cache: pnpm, and similar) are a separate free pool. They auto-evict unused entries after 7 days and do not count toward Actions artifact storage.
Split fast CI from heavy packaging
Keep fast, artifact-free checks on push and pull_request: lint, typecheck, unit tests, encoding guard, and similar.
Run heavy packaging (desktop installers, multi-OS release matrices, large artifact uploads) only on v* / SemVer release tags and on manual workflow_dispatch. Do not upload multi-gigabyte installer sets on every PR or Dependabot push.
Skill polyglot-ci ships a release-matrix template that follows this split. Pair it with a lightweight ci.yml.
Required retention
Every actions/upload-artifact step must set retention-days:
| Kind | Days | Notes |
|---|---|---|
Release handoff (files attached to a GitHub Release in a later job) |
|
Release assets themselves do not count toward Actions storage; the temporary workflow artifacts should expire right after publish. |
CI / debug artifacts (reports, logs, screenshots, smoke captures) |
|
Prefer |
Concurrency
On workflows that run on push or pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Rapid pushes then cancel superseded runs. Tag-only release workflows may omit this, or use cancel-in-progress: false (or cancel only when github.ref_type != 'tag').
Org and repo default (backstop)
In GitHub org and repo Settings → Actions → General, set Artifact and log retention to 7 days or less. That backstop does not replace retention-days on each upload. Agents must not change those settings unless you explicitly ask to apply the backstop on a named org or repo.
Portable source: general/ci-artifact-retention.mdunchecked.
Skills: polyglot-ci, ship-app.
Related
-
End-of-run commit (local-first) — fewer routine pushes also means less accidental CI
-
general/github-actions-versions.md— current action majors and Dependabot