From 08254cf126b12c793af1570867f41885e85a8c9d Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 1 Mar 2026 22:18:46 +0100 Subject: [PATCH] Enable docker layer caching for `dry-run` and `nightly` container builds (#36738) Enable Docker BuildKit layer caching for the dry-run and nightly container build workflows using GHCR registry cache. - **Dry-run** (`pull-docker-dryrun.yml`): adds `cache-from`, read-only, PRs can't write cache - **Nightly** (`release-nightly.yml`): adds `cache-from` and `cache-to` to both read and write cach --------- Co-authored-by: Claude Opus 4.6 --- .github/workflows/pull-docker-dryrun.yml | 2 ++ .github/workflows/release-nightly.yml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/pull-docker-dryrun.yml b/.github/workflows/pull-docker-dryrun.yml index 405521c354..bcc19e3eba 100644 --- a/.github/workflows/pull-docker-dryrun.yml +++ b/.github/workflows/pull-docker-dryrun.yml @@ -29,6 +29,7 @@ jobs: context: . platforms: linux/amd64,linux/arm64,linux/riscv64 push: false + cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful - name: Build rootless container image uses: docker/build-push-action@v6 with: @@ -36,3 +37,4 @@ jobs: push: false platforms: linux/amd64,linux/arm64,linux/riscv64 file: Dockerfile.rootless + cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index f073df05d3..a7b2fda042 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -120,6 +120,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} annotations: ${{ steps.meta.outputs.annotations }} + cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful + cache-to: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful,mode=max - name: build rootless docker image uses: docker/build-push-action@v6 with: @@ -129,3 +131,5 @@ jobs: file: Dockerfile.rootless tags: ${{ steps.meta_rootless.outputs.tags }} annotations: ${{ steps.meta_rootless.outputs.annotations }} + cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless + cache-to: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless,mode=max