Compare commits

...

1 Commits

Author SHA1 Message Date
Jiang Bohan
64646fcd35 feat(deploy): add frontend production deployment workflow and skill
Add a GitHub Actions workflow (workflow_dispatch) that promotes the
latest Vercel staging deployment to production using `vercel promote`.
Agents can trigger this via `gh workflow run`, enabling @-mention
driven deployments from Multica.

Also adds a deploy-frontend Claude Code skill with step-by-step
instructions for agents, and updates .gitignore to track skills.
2026-04-02 13:34:04 +08:00
3 changed files with 98 additions and 2 deletions

View File

@@ -0,0 +1,68 @@
---
name: deploy-frontend
description: >
Deploy the Multica frontend to production. Use this skill when asked to deploy the frontend,
promote to production, or ship the web app. Triggers a GitHub Actions workflow that promotes
the latest Vercel staging deployment to production.
---
# Deploy Frontend to Production
## Overview
The Multica frontend (Next.js app in `apps/web/`) is hosted on Vercel:
- **Staging** (`https://multica-app.copilothub.ai`): Auto-deploys on every merge to `main`.
- **Production**: Promoted from staging via the `Deploy Frontend to Production` GitHub Actions workflow.
## How to Deploy
### 1. Verify Staging
Before deploying, confirm that staging is healthy. Ask the user or check:
- The latest CI on `main` is green.
- Staging (`https://multica-app.copilothub.ai`) is working correctly.
### 2. Trigger the Deployment
Run the GitHub Actions workflow:
```bash
gh workflow run "Deploy Frontend to Production" --repo multica-ai/multica
```
### 3. Monitor the Deployment
Watch the workflow run:
```bash
gh run list --repo multica-ai/multica --workflow="Deploy Frontend to Production" --limit 1
```
To get detailed status:
```bash
gh run watch --repo multica-ai/multica $(gh run list --repo multica-ai/multica --workflow="Deploy Frontend to Production" --limit 1 --json databaseId --jq '.[0].databaseId')
```
### 4. Report the Result
After the workflow completes, post the result as a comment on the relevant issue. Include:
- Whether the deployment succeeded or failed.
- A link to the workflow run.
## Required Secrets
The GitHub Actions workflow requires these secrets (configured in the repo settings):
- `VERCEL_TOKEN` — Vercel API token with deploy permissions
- `VERCEL_PROJECT_ID` — The Vercel project ID for `multica-web-production`
- `VERCEL_ORG_ID` — The Vercel organization (team) ID for `indexlabs`
## Troubleshooting
- **Workflow not found**: Ensure the workflow file exists at `.github/workflows/deploy-production.yml`.
- **Permission denied**: The `gh` CLI must be authenticated with repo access.
- **Vercel errors**: Check that the secrets are correctly configured in the repo settings.

27
.github/workflows/deploy-production.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Deploy Frontend to Production
on:
workflow_dispatch:
inputs:
skip_confirmation:
description: "Skip confirmation (for automated triggers)"
required: false
default: "false"
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Install Vercel CLI
run: npm install -g vercel@latest
- name: Promote to Production
run: vercel promote --yes --token=${{ secrets.VERCEL_TOKEN }} --scope=indexlabs
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

5
.gitignore vendored
View File

@@ -34,8 +34,9 @@ apps/web/test-results/
# context (agent workspace)
.context
# local settings
.claude/
# local settings — ignore .claude/ except skills
.claude/*
!.claude/skills/
# feature tracking
_features/