Skip to content

ci: give each Docker workflow its own gha cache scope#89

Merged
skjnldsv merged 1 commit into
mainfrom
fix/ci-cache-scope-collision
Jul 7, 2026
Merged

ci: give each Docker workflow its own gha cache scope#89
skjnldsv merged 1 commit into
mainfrom
fix/ci-cache-scope-collision

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

Give `docker-publish.yml` and `docker-fork.yml` distinct GHA build-cache scopes (`publish` / `fork`), and add a per-workflow `concurrency` group that cancels superseded runs.

Why

On a fork PR both workflows fire and build the same Dockerfile. They shared the default `type=gha` cache scope, so their concurrent `cache-to` reservations collided:

```
ERROR: error writing layer blob: failed to reserve cache
ERROR: failed to build: failed to solve: error writing layer blob: failed to reserve cache
```

Seen on PR #87 (fork, labeled `ci: build image`) — the fork run and the publish build-only run started within ~3s of each other. Scoping the caches removes the collision; the concurrency groups keep only one live build per ref/PR.

Testing

  • Re-run the fork build on a labeled fork PR → build+push succeeds, no cache error.
  • Push to `main` → publish build succeeds using the `publish` cache scope.

AI-assisted change.

docker-publish.yml and docker-fork.yml build the same Dockerfile and
both fire on a fork PR, so they raced on the same default GHA cache
scope and failed with 'error writing layer blob: failed to reserve
cache'.

Give each workflow a distinct cache scope (publish / fork) so their
cache reservations no longer collide, and add a per-workflow concurrency
group to cancel superseded runs on the same ref/PR.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv enabled auto-merge July 7, 2026 09:51
@skjnldsv
skjnldsv merged commit 89e642a into main Jul 7, 2026
1 check passed
@skjnldsv
skjnldsv deleted the fix/ci-cache-scope-collision branch July 7, 2026 09:54
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