fix: add disk cleanup to CI and reduce Docker layers
Build & Deploy / build-and-push (backend) (push) Successful in 7m34s
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 8m19s
Build & Deploy / build-and-push (proxy) (push) Failing after 1m12s

Runner runs out of disk space during discord-gateway build.
Add docker system prune before build and combine Dockerfile
layers to reduce disk usage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-07-28 15:47:23 +07:00
co-authored by Claude Opus 4.8
parent 540a71f983
commit 7bebb23c1d
2 changed files with 8 additions and 4 deletions
+3
View File
@@ -20,6 +20,9 @@ jobs:
apt-get update -qq
apt-get install -y -qq --no-install-recommends ca-certificates git docker.io
git config --global http.sslVerify false
# Clean up runner disk before build
docker system prune -af --volumes 2>/dev/null || true
apt-get clean 2>/dev/null || true
- name: Checkout
run: |
+5 -4
View File
@@ -27,11 +27,12 @@ COPY packages/shared ./packages/shared
COPY services/discord-gateway ./services/discord-gateway
COPY services/discord-gateway/drizzle ./drizzle
# Build
# Build (combined to reduce layers)
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
pnpm --filter './packages/shared' run build
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
pnpm --filter './services/discord-gateway' run build
pnpm --filter './packages/shared' run build \
&& pnpm --filter './services/discord-gateway' run build \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create production-only deployment (no devDeps)
RUN pnpm deploy --legacy --filter '@bete/discord-gateway' /tmp/deploy \