Use registry build cache instead of gha cache
Build Hugo / build (push) Successful in 3m23s
Build Hugo / deploy (push) Failing after 39s

The GitHub-hosted 'gha' cache backend is unreachable from the
self-hosted Gitea runner (dial tcp 172.18.0.2:44181 i/o timeout), which
failed the build step even though the image pushed successfully. Switch
cache-from/cache-to to a registry-backed cache stored as a :buildcache
tag in the same Gitea registry, which works on self-hosted runners.
This commit is contained in:
2026-07-25 02:21:38 +01:00
parent eacf71d676
commit 4426668518
+5 -2
View File
@@ -46,8 +46,11 @@ jobs:
tags: | tags: |
${{ env.REGISTRY }}/${{ gitea.repository_owner }}/blog-ahmza-com:latest ${{ env.REGISTRY }}/${{ gitea.repository_owner }}/blog-ahmza-com:latest
${{ env.REGISTRY }}/${{ gitea.repository_owner }}/blog-ahmza-com:${{ gitea.event.head_commit.id }} ${{ env.REGISTRY }}/${{ gitea.repository_owner }}/blog-ahmza-com:${{ gitea.event.head_commit.id }}
cache-from: type=gha # Registry-backed build cache. The GitHub-hosted 'gha' cache is not
cache-to: type=gha,mode=max # reachable from self-hosted Gitea runners, so store the cache as a
# dedicated tag in the same registry instead.
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository_owner }}/blog-ahmza-com:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository_owner }}/blog-ahmza-com:buildcache,mode=max
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build