Skip to content

ci(deploy): enable layer caching in urunc-deploy image build - #1184

Open
Inuth0603 wants to merge 1 commit into
urunc-dev:mainfrom
Inuth0603:ci/cache-urunc-deploy-build
Open

Inuth0603 wants to merge 1 commit into
urunc-dev:mainfrom
Inuth0603:ci/cache-urunc-deploy-build

Conversation

@Inuth0603

Copy link
Copy Markdown
Contributor

Enable Buildx layer caching for the urunc-deploy image and reorder Dockerfile layers to avoid rebuilding unchanged dependencies. This follows up on #1102 and #1170.

Changes

  • Add GitHub Actions layer caching (type=gha, mode=max) scoped by architecture.
  • Disable the cache for version-tag builds so releases pick up current Alpine and pip packages.
  • Reorder the Dockerfile to cache Go module downloads, system packages and binary downloads across commits.
  • Move ARG COMMIT just before make so changing the commit SHA doesn't invalidate earlier layers.
  • Pin kubectl to v1.37.2 instead of fetching the latest version during the build.

Notes

The image is only built on pushes to main, so the Dockerfile changes were tested locally.

kubectl is now pinned to v1.37.2. This needs manual updates since Dependabot doesn't track Docker versions. docs/variables/versions.yml currently lists 1.30.0, so I'm happy to align the version if needed.

The cache uses mode=max, which also stores intermediate layers. If the GitHub Actions 10 GB cache limit becomes an issue, we can switch to a registry cache.

Related issues

Refs #1096

How was this tested?

  • Built the image locally on x86_64 using Docker Buildx.
  • Checked urunc --version, kubectl version --client and the image contents.
  • Rebuilt without changes and confirmed all steps were cached.
  • Changed COMMIT and confirmed only the affected build and copy steps reran, while dependency downloads and package installation remained cached.

The arm64 build and GitHub Actions cache backend still need to be verified by CI.

LLM usage

Google Gemini (via Antigravity) assisted with the Dockerfile layer ordering and workflow changes. I reviewed the changes and tested the build locally.

Checklist

Enable GitHub Actions layer caching (`type=gha`, `mode=max`) per
architecture in `build-latest.yml` and reorder layers in
`deployment/urunc-deploy/Dockerfile` so builder stages, Go module
downloads, and package installations remain cached across commits.

Pin `kubectl` through the `KUBECTL_VERSION` build argument, so that
cached builds stay reproducible, and disable the cache for version-tag
builds, so that releases always pick up package updates.

Refs urunc-dev#1096

Signed-off-by: Divyam Agarwal <iitdivyamagarwal@gmail.com>
@netlify

netlify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 9ee78c9
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6ae3a673a30dcf0f0a1e39f9

This branch has not been deployed

No deployments
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