diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-admin-frontend-dev.yml similarity index 87% rename from .github/workflows/deploy-frontend.yml rename to .github/workflows/deploy-admin-frontend-dev.yml index 34804b11..19ba148a 100644 --- a/.github/workflows/deploy-frontend.yml +++ b/.github/workflows/deploy-admin-frontend-dev.yml @@ -1,11 +1,11 @@ -name: Deploy Frontend to Vercel +name: "Dev Deploy to Vercel: Admin App Frontend" on: push: branches: [ main ] paths: - 'admin-wcc-app/**' - - '.github/workflows/deploy-frontend.yml' + - '.github/workflows/deploy-admin-frontend-dev.yml' jobs: deploy: @@ -32,13 +32,12 @@ jobs: NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY }} NEXT_PUBLIC_APP_URL: ${{ secrets.NEXT_PUBLIC_APP_URL }} - - name: Deploy to Vercel + - name: Deploy to Vercel (Dev) uses: amondnet/vercel-action@v25 with: vercel-token: ${{ secrets.VERCEL_TOKEN }} vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} working-directory: ./admin-wcc-app - vercel-args: '--prod' env: VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/deploy-admin-frontend-prod.yml b/.github/workflows/deploy-admin-frontend-prod.yml new file mode 100644 index 00000000..4a5810c9 --- /dev/null +++ b/.github/workflows/deploy-admin-frontend-prod.yml @@ -0,0 +1,40 @@ +name: "Prod Deploy to Vercel: Admin App Frontend" + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: admin-wcc-app + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + env: + NEXT_PUBLIC_API_BASE: ${{ secrets.NEXT_PUBLIC_API_BASE_PROD }} + NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY_PROD }} + NEXT_PUBLIC_APP_URL: ${{ secrets.NEXT_PUBLIC_APP_URL_PROD }} + + - name: Deploy to Vercel (Prod) + uses: amondnet/vercel-action@v25 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN_PROD }} + vercel-org-id: ${{ secrets.VERCEL_ORG_ID_PROD }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_PROD }} + working-directory: ./admin-wcc-app + vercel-args: '--prod' + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_PROD }} diff --git a/CLAUDE.md b/CLAUDE.md index 2496a2ca..114c916a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -459,7 +459,7 @@ Required for frontend (see `.env.example`): - `NEXT_PUBLIC_APP_URL` - Frontend URL (e.g., `https://dev-wcc-admin.vercel.app`) **GitHub Actions Deployment:** -Automated deployment via `.github/workflows/deploy-frontend.yml`: +Automated deployment via `.github/workflows/deploy-admin-frontend-dev.yml`: - Triggers on push to `main` branch when `admin-wcc-app/**` files change - Requires GitHub secrets: - `VERCEL_TOKEN` - Vercel API token diff --git a/README.md b/README.md index b80f47c5..fdeeabfd 100644 --- a/README.md +++ b/README.md @@ -344,8 +344,7 @@ avoid CORS issues. ### CI/CD and deploy (Vercel) -A GitHub Actions workflow is provided at `.github/workflows/deploy-frontend.yml` to deploy the -frontend to Vercel on pushes to `main`. Configure the following repository secrets: +A GitHub Actions workflow is provided at `.github/workflows/deploy-admin-frontend-dev.yml` to deploy the frontend to Vercel Dev environment on pushes to `main`. Configure the following repository secrets: - VERCEL_TOKEN - VERCEL_ORG_ID