ops: cache NAS build dependencies
CI / config (push) Canceled after 0s
CI / test-frontend (push) Canceled after 0s
CI / test-rust (push) Canceled after 0s
CI / test-e2e (push) Canceled after 0s
CI / test-e2e-release (push) Canceled after 0s
CI / build (push) Canceled after 0s
CI / release (push) Canceled after 0s
CI / docker (push) Canceled after 0s
CI / docker-website (push) Canceled after 0s

Install npm dependencies and the amd64 Rust target before copying changing source files so routine builds can reuse those layers.

Co-Authored-By: Codex <noreply@anthropic.com>
This commit is contained in:
2026-08-12 15:06:04 +08:00
co-authored by Codex
parent 7928ebf4f2
commit 81799e714a
+6 -4
View File
@@ -9,11 +9,13 @@ RUN printf '#!/bin/sh\nexit 1\n' > /usr/local/bin/git \
&& chmod +x /usr/local/bin/git
WORKDIR /src
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
ARG GITHUB_SHA=unknown
RUN npm ci \
&& npm run build
RUN npm run build
FROM --platform=$BUILDPLATFORM rust:bookworm AS server-builder
@@ -29,13 +31,13 @@ RUN sed -i \
gcc-x86-64-linux-gnu libc6-dev-amd64-cross \
&& rm -rf /var/lib/apt/lists/*
RUN rustup target add x86_64-unknown-linux-gnu
WORKDIR /src
COPY . .
COPY --from=client-builder /src/client_bundle /src/client_bundle
COPY --from=client-builder /src/version.json /src/version.json
RUN rustup target add x86_64-unknown-linux-gnu
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc \
CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc