diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29c73603a..870269aed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,8 @@ jobs: with: filters: | kilocode_backend: + - '.github/workflows/ci.yml' + - '.github/workflows/deploy-production.yml' - 'apps/web/src/**' - 'apps/web/package.json' - 'apps/web/tsconfig.json' @@ -257,7 +259,7 @@ jobs: restore-keys: | ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- - - name: Setup Vercel ENV + - name: Pull Vercel environment working-directory: apps/web run: | pnpm install --global vercel@latest diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 0b0a2dd38..ed2294818 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -35,121 +35,12 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - # Setup Vercel ENV — link from repo root; Vercel rootDirectory (apps/web) is set on the dashboard - - run: pnpm install --global vercel@latest - - run: vercel link --project=kilocode-app --token=${{ secrets.VERCEL_TOKEN }} --yes - - run: vercel env pull .env.local --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Run Drizzle migrations - run: NODE_ENV=production pnpm run drizzle migrate - - deploy-app: - runs-on: ${{ vars.RUNNER_LARGE_LABEL || 'ubuntu-24.04-8core' }} - timeout-minutes: 30 - needs: run-migrations - environment: production - - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_APP }} - - steps: - - name: Checkout code - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 - with: - lfs: true - - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - - - name: Setup Node.js - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Cache Next.js build - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - path: | - ~/.npm - ${{ github.workspace }}/apps/web/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- - - - name: Install Vercel CLI - run: pnpm install --global vercel@latest - - - run: vercel link --project=kilocode-app --token=${{ secrets.VERCEL_TOKEN }} --yes - - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - - name: Build Project Artifacts - env: - NODE_OPTIONS: '--max-old-space-size=8192' - run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} - - deploy-global-app: - runs-on: ${{ vars.RUNNER_LARGE_LABEL || 'ubuntu-24.04-8core' }} - timeout-minutes: 30 - needs: run-migrations - environment: production - - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_GLOBAL_APP }} - - steps: - - name: Checkout code - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 - with: - lfs: true - - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - - - name: Setup Node.js - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Cache Next.js build - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - path: | - ~/.npm - ${{ github.workspace }}/apps/web/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- - - - name: Install Vercel CLI - run: pnpm install --global vercel@latest - - - run: vercel link --project=kilocode-global-app --token=${{ secrets.VERCEL_TOKEN }} --yes - - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - - name: Build Project Artifacts env: - NODE_OPTIONS: '--max-old-space-size=8192' - run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} + NODE_ENV: production + POSTGRES_URL: ${{ secrets.POSTGRES_MIGRATION_URL }} + DATABASE_CA: ${{ secrets.DATABASE_CA }} + run: pnpm run drizzle migrate check-kiloclaw-changes: runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}