From 36db8f73ca0798465efc1289ca6fb4615f720061 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Sun, 31 May 2026 21:37:01 -0700 Subject: [PATCH] Optimize CI pipeline: merge check jobs, remove docker install, improve layer caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Merge typecheck + lint into a single `check` job to eliminate one full job lifecycle and one npm ci invocation (~2-4 min savings) - Remove `apt-get install docker.io` step — Docker CLI and buildx v0.23.0 are now pre-installed in the custom brackt-runner:latest image - Reorder Dockerfile build-env COPY layers so node_modules and config files are copied before source, improving registry cache hit granularity - Expand .dockerignore to exclude .forgejo, .git, docs, plans, cypress, logs, .env files, and tsbuildinfo files from the build context Co-Authored-By: Claude Sonnet 4.6 --- .dockerignore | 13 ++++++++++++- .forgejo/workflows/deploy.yml | 28 +++++++--------------------- Dockerfile | 10 ++++++++-- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9b8d514..5082345 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,15 @@ .react-router build node_modules -README.md \ No newline at end of file +README.md +.forgejo +.git +.claude +.grepai +docs +plans +cypress +*.log +.env* +!.env.example +tsconfig.*.tsbuildinfo diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index aca8d47..a08cfbf 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -44,24 +44,10 @@ jobs: DATABASE_URL: postgresql://test:test@postgres:5432/brackt_test NODE_OPTIONS: --max-old-space-size=4096 - typecheck: - name: ʦ TypeScript + check: + name: ʦ🔍 Typecheck & Lint runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: ⬇️ Checkout repo - uses: https://github.com/actions/checkout@v4 - - - name: 📥 Install dependencies - run: npm ci - - - name: 🔎 Type check - run: npm run typecheck - - lint: - name: 🔍 Lint - runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 steps: - name: ⬇️ Checkout repo uses: https://github.com/actions/checkout@v4 @@ -72,9 +58,12 @@ jobs: - name: 🔍 Lint (oxlint) run: npm run lint + - name: 🔎 Type check + run: npm run typecheck + build: name: 🐳 Build - needs: [test, typecheck, lint] + needs: [test, check] if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} runs-on: ubuntu-latest timeout-minutes: 30 @@ -82,9 +71,6 @@ jobs: - name: ⬇️ Checkout repo uses: https://github.com/actions/checkout@v4 - - name: 🐳 Install Docker CLI - run: apt-get update -qq && apt-get install -y -qq docker.io - - name: 🐳 Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index c4cb94d..b1870a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,15 @@ WORKDIR /app RUN --mount=type=secret,id=npmrc,target=/app/.npmrc npm ci --omit=dev FROM node:20-alpine AS build-env -COPY . /app/ -COPY --from=development-dependencies-env /app/node_modules /app/node_modules WORKDIR /app +COPY --from=development-dependencies-env /app/node_modules /app/node_modules +COPY package.json package-lock.json tsconfig*.json vite.config.ts react-router.config.ts drizzle.config.ts ./ +COPY scripts/ /app/scripts/ +COPY app/ /app/app/ +COPY server/ /app/server/ +COPY database/ /app/database/ +COPY public/ /app/public/ +COPY instrument.server.mjs ./ RUN npm run build FROM node:20-alpine