-
Notifications
You must be signed in to change notification settings - Fork 35
ci(vercel): delegate app deploys to vercel #2796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Production promotion is no longer serialized behind migrations Once the |
||
|
|
||
| check-kiloclaw-changes: | ||
| runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }} | ||
|
|
||
There was a problem hiding this comment.
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 pullfor 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.