performance: set up cache mount for build via Dockerfile

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
squidfunk
2025-12-20 17:54:59 +01:00
parent ea091d6064
commit 2be1cfb668
2 changed files with 10 additions and 1 deletions
+6
View File
@@ -270,15 +270,21 @@ jobs:
runs-on: ubuntu-latest
env:
IMAGE: ${{ github.event.repository.full_name }}
DOCKER_BUILDKIT: 1
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref || github.sha }}
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: ${{ env.IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
+4 -1
View File
@@ -62,7 +62,10 @@ COPY README.md README.md
COPY uv.lock uv.lock
# Install dependencies
RUN uv sync --dev --no-install-project
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/root/.cache/uv \
uv sync --dev --no-install-project
# Copy files to build project
COPY . .