Skip to content

feat(docs): add API deployment migration guide#326

Open
amondnet wants to merge 3 commits into
masterfrom
amondnet/puzzle-mochi
Open

feat(docs): add API deployment migration guide#326
amondnet wants to merge 3 commits into
masterfrom
amondnet/puzzle-mochi

Conversation

@amondnet

@amondnet amondnet commented Mar 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add migration guide section to README for the CLI → API transition (refactor: migrate to API-based deployment #325)
  • Include vercel-args to API inputs mapping table
  • Document deprecated inputs (vercel-args, scope)
  • Provide step-by-step migration instructions and CLI fallback option
  • Migrate example workflows to prebuilt deployment

Relates to #325

Test plan

  • README renders correctly on GitHub
  • All YAML examples are valid

Copilot AI review requested due to automatic review settings March 29, 2026 10:27
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for team-scope-test ready!

Project:team-scope-test
Status: ✅  Deploy successful!
Preview URL:https://team-scope-test-g682pfxee-dietfriends.vercel.app
Latest Commit:f807277

Deployed with vercel-action

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/example-static.yml">

<violation number="1" location=".github/workflows/example-static.yml:70">
P1: Pushes to `feature/*` branches will now be deployed as production (`--prod`) instead of preview. The old shell-script logic only set `--prod` for `refs/heads/master`, but the new conditional `github.event_name == 'push'` matches all push events including feature branches.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant GHA as GitHub Actions Runner
    participant FS as Local Filesystem
    participant VAPI as Vercel Cloud API

    Note over GHA,VAPI: Prebuilt Deployment Flow (Preview & Production)

    GHA->>GHA: Setup Node.js & pnpm
    GHA->>FS: pnpm install (frozen-lockfile)

    rect rgb(240, 240, 240)
        Note right of GHA: NEW: Environment Sync Phase
        GHA->>VAPI: NEW: vercel pull (with VERCEL_TOKEN, ORG_ID, PROJECT_ID)
        VAPI-->>GHA: Project settings & environment variables
        GHA->>FS: Write to .vercel/project.json & .env
    end

    alt Trigger: pull_request_target
        GHA->>GHA: NEW: vercel build (Preview)
        GHA->>FS: Generate artifacts in .vercel/output
        GHA->>GHA: Execute Vercel Action
        GHA->>VAPI: CHANGED: vercel deploy --prebuilt
    else Trigger: push (main/master)
        GHA->>GHA: NEW: vercel build --prod (Production)
        GHA->>FS: Generate artifacts in .vercel/output
        GHA->>GHA: Execute Vercel Action
        GHA->>VAPI: CHANGED: vercel deploy --prod --prebuilt
    end

    VAPI-->>GHA: Return Deployment URL & Metadata
    GHA->>GHA: Post deployment alias/commenting
Loading

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread .github/workflows/example-static.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the repository’s example GitHub Actions workflows to a consistent Vercel “pull → build → deploy --prebuilt” deployment flow, aligning examples with the action’s prebuilt deployment capabilities.

Changes:

  • Add pnpm/Node setup and a vercel pull step to each example workflow.
  • Split preview vs production builds into explicit conditional steps.
  • Switch deployments to --prebuilt and remove vercel-org-id from action inputs in examples.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
.github/workflows/example-angular.yml Adds Vercel pull/build steps and deploys using --prebuilt with updated working directory.
.github/workflows/example-express-basic-auth.yml Adds pnpm/Node setup plus Vercel pull/build and deploys prebuilt for preview/prod.
.github/workflows/example-scope.yml Adds pnpm/Node setup, Vercel pull/build, and deploys prebuilt with team scope.
.github/workflows/example-static.yml Adds pnpm/Node setup, Vercel pull/build, and deploys prebuilt for preview/prod with aliases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 43 to 51
- uses: ./
id: now-deployment-staging
if: github.event_name == 'pull_request_target'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_STATIC }}
vercel-args: --prebuilt
working-directory: example/static

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vercel-org-id was removed but vercel-project-id is still passed. In this action, providing only vercel-project-id triggers a warning and does not export VERCEL_PROJECT_ID (it only exports when both org+project are present). Either pass both inputs, set VERCEL_ORG_ID/VERCEL_PROJECT_ID on the action step (job-level env), or remove both inputs and rely entirely on the .vercel/project.json created by vercel pull.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +33
- name: Pull Vercel environment
run: |
pnpm install --frozen-lockfile
pnpm exec vercel pull --yes --token=${VERCEL_TOKEN}
working-directory: example/team-scope
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_TEAM_SCOPE }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_TEAM_SCOPE }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm install is executed with working-directory: example/team-scope, but example/team-scope has no package.json. This will fail (or be pnpm-version dependent). Run pnpm install at the workspace root (or add a package.json for this example), and keep the Vercel commands scoped via working-directory.

Copilot uses AI. Check for mistakes.
Comment on lines 42 to 51
- uses: ./
id: now-deployment-staging
if: github.event_name == 'pull_request_target'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_TEAM_SCOPE }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_TEAM_SCOPE }}
vercel-args: --prebuilt
working-directory: example/team-scope
scope: ${{ secrets.VERCEL_SCOPE }}

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vercel-org-id was removed but vercel-project-id is still passed. In this action, providing only vercel-project-id triggers a warning and does not export VERCEL_PROJECT_ID (it only exports when both org+project are present). Either pass both inputs, set VERCEL_ORG_ID/VERCEL_PROJECT_ID on the action step (job-level env), or remove both inputs and rely entirely on the .vercel/project.json created by vercel pull.

Copilot uses AI. Check for mistakes.
Comment on lines 42 to 50
- uses: ./
id: now-deployment-staging
if: github.event_name == 'pull_request_target'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_AUTH }}
vercel-args: --prebuilt
working-directory: example/express-basic-auth

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vercel-org-id was removed but vercel-project-id is still passed. In this action, providing only vercel-project-id triggers a warning and does not export VERCEL_PROJECT_ID (it only exports when both org+project are present). Either pass both inputs, set VERCEL_ORG_ID/VERCEL_PROJECT_ID on the action step (job-level env), or remove both inputs and rely entirely on the .vercel/project.json created by vercel pull.

Copilot uses AI. Check for mistakes.
Comment on lines 47 to 56
- uses: ./
id: vercel-action-staging
if: github.event_name == 'pull_request_target'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_ANGULAR }}
working-directory: example/angular/dist/angular
vercel-args: --prebuilt
working-directory: example/angular
alias-domains: |

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vercel-org-id was removed but vercel-project-id is still passed. In this action, providing only vercel-project-id triggers a warning and does not export VERCEL_PROJECT_ID (it only exports when both org+project are present). Either pass both inputs, set VERCEL_ORG_ID/VERCEL_PROJECT_ID on the action step (job-level env), or remove both inputs and rely entirely on the .vercel/project.json created by vercel pull.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +29
- name: Pull Vercel environment
run: |
pnpm install --frozen-lockfile
pnpm exec vercel pull --yes --token=${VERCEL_TOKEN}

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm install is executed with working-directory: example/static, but example/static has no package.json. pnpm will fail in directories without a manifest (or behave inconsistently across versions). Run pnpm install at the repo/workspace root (or add a package.json for this example), and keep the Vercel commands scoped via working-directory.

Suggested change
- name: Pull Vercel environment
run: |
pnpm install --frozen-lockfile
pnpm exec vercel pull --yes --token=${VERCEL_TOKEN}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Pull Vercel environment
run: pnpm exec vercel pull --yes --token=${VERCEL_TOKEN}

Copilot uses AI. Check for mistakes.
Comment on lines +56 to 71
- name: Build (production)
if: github.event_name == 'push'
run: pnpm exec vercel build --prod
working-directory: example/static
env:
REF: ${{ github.ref }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_STATIC }}
- uses: ./
id: now-deployment-production
if: github.event_name == 'push'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_STATIC }}
vercel-args: ${{ steps.prod_or_not.outputs.vercel-args }}
vercel-args: --prod --prebuilt
working-directory: example/static

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow runs on push to both master and feature/*, but the production deploy step always uses vercel-args: --prod --prebuilt. That will create production deployments from feature branches (regression vs the previous branch check). Add a ref check so --prod is only used on the default branch, and deploy previews for other pushed branches (or remove feature/* from the push trigger).

Copilot uses AI. Check for mistakes.
amondnet added 2 commits April 2, 2026 15:54
- Add vercel pull -> vercel build -> vercel deploy --prebuilt flow
- Add pnpm/node setup steps where missing
- Remove vercel-org-id input (now set via env vars in pull step)
- Separate preview/production builds with conditional steps
- Replace shell script for prod_or_not with explicit conditional build steps
Add migration guide section to README documenting the transition
from CLI-based to API-based deployment introduced in #325.
Includes vercel-args to API inputs mapping table, step-by-step
migration instructions, and deprecated inputs reference.
@amondnet amondnet force-pushed the amondnet/puzzle-mochi branch from f807277 to d515e66 Compare April 2, 2026 07:02
@amondnet amondnet changed the title refactor(example): migrate all example workflows to prebuilt deployment feat(docs): add API deployment migration guide Apr 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Apr 2, 2026

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Auto-approved: Documentation update and migration guide for API-based deployment. Updates example workflows to follow current best practices for prebuilt deployments. No changes to core action logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants