Skip to content

Preview deployments — deploy each git branch to a unique URL #10

Description

@aynaash

Summary

Implement preview deployments so each git branch/PR gets its own unique URL, similar to Vercel's preview system.

Expected Behavior

# On branch "feature/new-homepage"
nextdeploy ship --preview

# Deploys to: feature-new-homepage.myapp.nextdeploy.app
# Or: preview-abc123.d1234.cloudfront.net

Design Options

  1. Lambda aliases — Create a Lambda alias per branch, route via CloudFront behavior
  2. Separate Lambda functions<app>-preview-<branch> with separate Function URLs
  3. Path-based — Single Lambda with branch routing via header/path

Required Components

  • Branch name detection from git
  • Unique subdomain or path generation
  • Separate S3 prefix for preview assets
  • Cleanup mechanism for stale previews

Commands

nextdeploy ship --preview          # Deploy current branch as preview
nextdeploy preview list            # List active previews
nextdeploy preview delete <branch> # Delete a preview

Difficulty: Hard · Language: Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions