Skip to content

Commit d515e66

Browse files
committed
feat(docs): add API deployment migration guide
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.
1 parent cb39be2 commit d515e66

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,87 @@ The deployment lifecycle:
360360

361361
> **Note:** GitHub Deployment errors are non-blocking. If the GitHub API call fails, the Vercel deployment will still proceed normally.
362362

363+
## Migration to API-based Deployment (v42.2.0+)
364+
365+
Starting with v42.2.0, this action uses the `@vercel/client` API by default instead of the Vercel CLI. This is **not a breaking change** — existing workflows using `vercel-args` will continue to work via CLI fallback.
366+
367+
### What changed
368+
369+
| Before (CLI via `vercel-args`) | After (API inputs) |
370+
|---------------------------------|-----------------------------|
371+
| `vercel-args: --prod` | `target: production` |
372+
| `vercel-args: --prebuilt` | `prebuilt: true` |
373+
| `vercel-args: --force` | `force: true` |
374+
| `vercel-args: --public` | `public: true` |
375+
| `vercel-args: --with-cache` | `with-cache: true` |
376+
| `vercel-args: --archive=tgz` | `archive: tgz` |
377+
| `vercel-args: --regions iad1` | `regions: iad1` |
378+
| `vercel-args: --env KEY=VAL` | `env: KEY=VAL` (multiline) |
379+
| `vercel-args: --build-env K=V` | `build-env: K=V` (multiline)|
380+
| `scope: my-team` | `vercel-org-id: team_xxx` |
381+
382+
### Migration steps
383+
384+
1. **Remove `vercel-args`** and replace with equivalent API inputs:
385+
386+
```yaml
387+
# Before
388+
- uses: amondnet/vercel-action@v25
389+
with:
390+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
391+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
392+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
393+
vercel-args: --prod --force
394+
395+
# After
396+
- uses: amondnet/vercel-action@v25
397+
with:
398+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
399+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
400+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
401+
target: production
402+
force: true
403+
```
404+
405+
2. **Replace `scope`** with `vercel-org-id` (your team ID):
406+
407+
```yaml
408+
# Before
409+
scope: my-team-slug
410+
411+
# After
412+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # team_xxxxx
413+
```
414+
415+
3. **Prebuilt deployments** — use the `prebuilt` input:
416+
417+
```yaml
418+
- uses: amondnet/vercel-action@v25
419+
with:
420+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
421+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
422+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
423+
prebuilt: true
424+
target: production
425+
```
426+
427+
### Keeping CLI mode
428+
429+
If you prefer to stay on CLI-based deployment, simply keep using `vercel-args`. The action will automatically use the CLI client when `vercel-args` is provided:
430+
431+
```yaml
432+
- uses: amondnet/vercel-action@v25
433+
with:
434+
vercel-args: --prod --force # CLI fallback
435+
```
436+
437+
### Deprecated inputs
438+
439+
| Input | Status | Replacement |
440+
|----------------|--------------|----------------------------|
441+
| `vercel-args` | Deprecated | Use API inputs (`target`, `prebuilt`, `force`, etc.) |
442+
| `scope` | Deprecated | Use `vercel-org-id` |
443+
363444
## Migration from v2
364445

365446
1. Change action name in `workflows` from `now-deployment` to `vercel-action`

0 commit comments

Comments
 (0)