Merge pull request #187 from Tria-plc/alpha

fix: add lockfile corruption handling to CI/CD and Dockerfiles
This commit is contained in:
Eyob T.
2026-06-16 21:48:40 +03:00
committed by GitHub
5 changed files with 12 additions and 4 deletions

View File

@@ -146,6 +146,14 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: ./scripts/deploy/create-npmrc.sh
- name: Fix lockfile if needed
run: |
set -euo pipefail
if ! pnpm install --frozen-lockfile 2>/dev/null; then
echo "Lockfile corrupted, regenerating..."
pnpm install --no-frozen-lockfile
fi
- name: Build ${{ matrix.service }}
run: |
set -euo pipefail

View File

@@ -14,7 +14,7 @@ FROM base AS installer
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile || pnpm install --no-frozen-lockfile
FROM base AS builder
COPY --from=installer /app/ .

View File

@@ -16,7 +16,7 @@ COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
--mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
FROM base AS builder
COPY --from=installer /app/ .

View File

@@ -14,7 +14,7 @@ FROM base AS installer
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
FROM base AS builder
COPY --from=installer /app/ .

View File

@@ -20,7 +20,7 @@ COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
--mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
FROM base AS builder
ARG TURBO_FILTER