Skip to content

Commit 9a7d298

Browse files
committed
ci: fix prod-deploy.yml
1 parent d6129de commit 9a7d298

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/prod-deploy.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: "Deploy (Production)"
22
on:
33
workflow_dispatch:
4+
input:
5+
deploy-backend:
6+
type: boolean
7+
description: Deploy backend to Railway
48

59
concurrency:
610
group: deploy-${{ github.head_ref }}
@@ -245,7 +249,7 @@ jobs:
245249
vercel-args: '--prebuilt --prod'
246250
working-directory: packages/ui/dev
247251
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
248-
vercel-project-id: ${{ secrets.VERCEL_UI_DEV_PROJECT_ID}}
252+
vercel-project-id: ${{ secrets.VERCEL_UI_DEV_PROJECT_ID }}
249253

250254
deploy-highlight-package:
251255
name: Deploy @codeimage/highlight app
@@ -284,10 +288,10 @@ jobs:
284288
vercel-args: '--prebuilt --prod'
285289
working-directory: packages/highlight/dev
286290
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
287-
vercel-project-id: ${{ secrets.VERCEL_UI_DEV_PROJECT_ID}}
291+
vercel-project-id: ${{ secrets.VERCEL_HIGHLIGHT_DEV_PROJECT_ID }}
288292

289293
deploy-api:
290-
name: Build Api
294+
name: Build and Deploy Api
291295
environment: Production
292296
needs: [ install, lint, typecheck-packages, test-api, build-api ]
293297
runs-on: ubuntu-latest
@@ -320,16 +324,19 @@ jobs:
320324
key: rest-api-bundle-${{ github.run_id }}-${{ github.run_number }}
321325

322326
- name: Install Railway
327+
if: ${{ github.event.inputs.deploy-backend == 'true' }}
323328
run: pnpm i -g @railway/cli
324329

325-
- name: Run prod igrations
330+
- name: Run prod migrations
331+
if: ${{ github.event.inputs.deploy-backend == 'true' }}
326332
run: |
327333
pnpm --filter=@codeimage/api exec prisma migrate deploy
328334
env:
329335
DATABASE_URL: ${{ secrets.NEXT_DATABASE_URL }}
330336
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
331337

332338
- name: Railway Push to Deploy
339+
if: ${{ github.event.inputs.deploy-backend == 'true' }}
333340
run: |
334341
cd dist/api-bundle
335342
rm -rf .gitignore

0 commit comments

Comments
 (0)