store: Gitea Actions: Docker buildx cache auth requires login on all builds

This commit is contained in:
Cal Corum 2026-02-13 15:09:47 -06:00
parent 20f4710f41
commit a1f5be3e68

View File

@ -0,0 +1,17 @@
---
id: 77cf0fb1-9a58-43d2-b1d2-6532bafa6204
type: solution
title: "Gitea Actions: Docker buildx cache auth requires login on all builds"
tags: [gitea, docker, ci-cd, buildx, cache, fix]
importance: 0.7
confidence: 0.8
created: "2026-02-13T21:09:47.183681+00:00"
updated: "2026-02-13T21:09:47.183681+00:00"
---
When using Docker buildx with registry-based cache (cache-from/cache-to type=registry), the Docker Hub login step must run on ALL builds (both PR and main), not just main branch. Without login, PR builds fail on second run with 'push access denied' when trying to write cache layers.
Fix: Remove 'if: github.ref == refs/heads/main' condition from Docker Hub login step in workflow template. The push flag on build-push-action still gates actual image publishing to main-only.
Template: server-configs/gitea/workflow-templates/docker-build-template.yml
Error manifests on SECOND build because first build creates cache successfully, but subsequent builds fail when overwriting existing layers without auth.