Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -257,7 +259,7 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-

- name: Setup Vercel ENV
- name: Pull Vercel environment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: CI build still depends on pulling Vercel environment values

This restores vercel env pull for the app build, so any production env var marked Sensitive in Vercel will not be retrievable by this GitHub Action. Once those secrets are converted, the CI production build can fail or run with missing env values even though the Vercel Git Integration build has them injected.

working-directory: apps/web
run: |
pnpm install --global vercel@latest
Expand Down
117 changes: 4 additions & 113 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Production promotion is no longer serialized behind migrations

Once the deploy-app and deploy-global-app jobs are removed, this workflow stops providing any in-repo ordering between a main push and the Vercel production rollout. Unless both Vercel projects already have a deployment check wired to Deploy to Production / run-migrations, schema-dependent app code can be promoted before this job finishes and start reading the old database shape.


check-kiloclaw-changes:
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
Expand Down
Loading