diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 45d12f6..02d35ef 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -48,6 +48,12 @@ jobs: sleep "$delay" done + - name: Prepare SharedCode Git mirror for Docker + working-directory: ${{ github.workspace }} + run: | + rm -rf SharedCode.git + git clone --bare --branch main --single-branch SharedCode SharedCode.git + # Multi-arch (arm64) is only built and published from main; other branches and PRs # only need an amd64 build to validate they compile, which needs no emulation. - name: Set up QEMU (multi-arch builds) diff --git a/docker/Dockerfile b/docker/Dockerfile index b54c733..00c2537 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,9 @@ FROM node:22-alpine AS frontend-builder RUN apk add --no-cache git WORKDIR /frontend COPY frontend/package*.json ./ -RUN for attempt in 1 2 3 4 5; do \ +RUN --mount=type=bind,source=SharedCode.git,target=/tmp/SharedCode.git,readonly \ + git config --global url."file:///tmp/SharedCode.git".insteadOf "https://repos.gfranz.ch/Gabriel20xx/SharedCode.git" && \ + for attempt in 1 2 3 4 5; do \ npm ci && break; \ if [ "$attempt" -eq 5 ]; then exit 1; fi; \ delay=$((attempt * 5)); \