Skip to content

feat(build,deploy)!: switch build→deploy handoff from artifacts to Actions cache - #21

Open
arnavchachra wants to merge 1 commit into
mainfrom
feat/cache-build-handoff
Open

feat(build,deploy)!: switch build→deploy handoff from artifacts to Actions cache#21
arnavchachra wants to merge 1 commit into
mainfrom
feat/cache-build-handoff

Conversation

@arnavchachra

@arnavchachra arnavchachra commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

The build → deploy handoff uploaded the build output as an Actions artifact. When a repo's artifact storage quota is exhausted, upload-artifact fails with Failed to CreateArtifact: Artifact storage quota has been hit, failing the build even though the build itself succeeded. Quota is only recalculated every 6–12h, so the only recourse was retrying later.

Solution

Replace the artifact handoff with the Actions cache:

  • build: output: cache saves build-output-path under a caller-supplied cache-key (via actions/cache/save).
  • deploy: restore-cache: "true" restores it (via actions/cache/restore, exact-key match, no restore-keys), then a follow-up step fails the deploy on cache-hit != 'true'.

Cache entries can be LRU-evicted or expire; the exact-key restore + fail-on-miss guard turns that into a loud, retryable pipeline failure rather than a silent empty/stale deploy. Callers pass a run-unique key (e.g. build-${{ github.sha }}-${{ github.run_id }}) to both jobs so build/deploy agree and re-runs/concurrent runs don't collide.

actions/cache is pinned to v4.3.0. The Docker and Cloud Run paths are untouched.

Breaking change

The artifact handoff is removed:

  • build drops output: artifact, artifact-name, artifact-retention-days (output is now cache | none, default none).
  • deploy drops download-artifact, artifact-name.

Ships as a new major. Consumers on the artifact handoff migrate by setting output: cache + cache-key on build and restore-cache: "true" + matching cache-key on deploy.

Org-wide consumer audit (americangunowners, fajardo-trucking, logixa-hq, nurdsoft — all non-archived repos, default branches): only two live pipelines use the artifact handoff — logixa-hq/frontend-web (pinned @v2) and fajardo-trucking/frontend-web (pinned @v3.1.0). Every other build/deploy consumer uses the Docker/Cloud Run path or output: none, and all consumers pin an older major, so none is affected until deliberately migrated to this major.

Verify

  • output: cache + matching restore-cache: deploy finds the build output and ships it.
  • Restore with a non-existent/mismatched cache-key → deploy fails at "Fail on build cache miss" (no empty deploy).
  • Docker / Cloud Run consumers (no handoff inputs) are unaffected.

…ions cache

build gains `output: cache`, which saves `build-output-path` under a caller-
supplied `cache-key` via actions/cache/save. deploy gains `restore-cache`, which
restores it via actions/cache/restore using an exact-key match and fails the
deploy on a cache miss -- so an evicted or missing cache is a loud failure,
never a silent empty deploy. Callers pass a run-unique `cache-key` (e.g.
including github.run_id) to both sides.

The artifact handoff is removed. This sidesteps the Actions artifact storage
quota, whose exhaustion fails the build's upload step even when the build
itself succeeds.

BREAKING CHANGE: build no longer supports `output: artifact`, `artifact-name`,
or `artifact-retention-days`, and deploy no longer supports `download-artifact`
or `artifact-name`. Callers using the artifact handoff must switch to the cache
handoff: set `output: cache` + `cache-key` on build, and `restore-cache: "true"`
+ a matching `cache-key` on deploy.
@arnavchachra
arnavchachra force-pushed the feat/cache-build-handoff branch from 921a2e2 to 25f68fe Compare July 24, 2026 14:32
@arnavchachra arnavchachra changed the title feat(build,deploy): add Actions cache handoff as an artifact alternative feat(build,deploy)!: switch build→deploy handoff from artifacts to Actions cache Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant