From c00ac88f267cd1e1778b394af7996c14ab046a0b Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Wed, 8 Apr 2026 23:07:45 +0700 Subject: [PATCH] fix(deploy): allow variable expansion in deploy scripts and add web health route Fix heredoc quoting in deploy workflow to allow IMAGE_TAG and REGISTRY_URL variable expansion. Add Next.js API health check route. Co-Authored-By: Paperclip --- .github/workflows/deploy.yml | 4 ++-- apps/web/app/api/health/route.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 apps/web/app/api/health/route.ts diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f098ce5..5490902 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -176,7 +176,7 @@ jobs: scp -i ~/.ssh/deploy_key docker-compose.prod.yml "$DEPLOY_USER@$DEPLOY_HOST:~/goodgo/" scp -i ~/.ssh/deploy_key -r monitoring/ "$DEPLOY_USER@$DEPLOY_HOST:~/goodgo/monitoring/" - ssh -i ~/.ssh/deploy_key "$DEPLOY_USER@$DEPLOY_HOST" << 'DEPLOY_SCRIPT' + ssh -i ~/.ssh/deploy_key "$DEPLOY_USER@$DEPLOY_HOST" << DEPLOY_SCRIPT cd ~/goodgo export IMAGE_TAG="${IMAGE_TAG}" export REGISTRY_URL="${REGISTRY_URL}" @@ -240,7 +240,7 @@ jobs: scp -i ~/.ssh/deploy_key docker-compose.prod.yml "$DEPLOY_USER@$DEPLOY_HOST:~/goodgo/" scp -i ~/.ssh/deploy_key -r monitoring/ "$DEPLOY_USER@$DEPLOY_HOST:~/goodgo/monitoring/" - ssh -i ~/.ssh/deploy_key "$DEPLOY_USER@$DEPLOY_HOST" << 'DEPLOY_SCRIPT' + ssh -i ~/.ssh/deploy_key "$DEPLOY_USER@$DEPLOY_HOST" << DEPLOY_SCRIPT cd ~/goodgo export IMAGE_TAG="${IMAGE_TAG}" export REGISTRY_URL="${REGISTRY_URL}" diff --git a/apps/web/app/api/health/route.ts b/apps/web/app/api/health/route.ts new file mode 100644 index 0000000..4cc596f --- /dev/null +++ b/apps/web/app/api/health/route.ts @@ -0,0 +1,9 @@ +import { NextResponse } from 'next/server'; + +export function GET() { + return NextResponse.json({ + status: 'ok', + service: 'goodgo-web', + timestamp: new Date().toISOString(), + }); +}