Preview Deploys

A preview deploy uploads a new revision without changing what production serves. You get a URL to check, share, and test against—and production stays exactly as it was until you decide otherwise.

surge --preview
$ surge ./dist example.com --preview

        project: ./dist
         domain: example.com
         upload: [====================] 100%

   Success! - Preview available at 1719852000000.example.com

(--stage and -s are aliases for --preview.)

The preview URL

Every revision—previewed or published—gets a permanent URL of its own, served over the same CDN as production. That URL is stable for the life of the revision, so it works for:

  • Review: send the link to a teammate or client before shipping.
  • Testing: point integration tests at the exact bits that will go live.
  • History: every past deploy remains viewable at its revision URL, listed by surge list <domain>.

Shipping a preview

When the preview looks right, cut it over to production:

surge cutover example.com

cutover points production at the latest revision—the one you just previewed. Nothing is re-uploaded; the switch is atomic. If you previewed several candidates, pass the specific revision to ship:

surge cutover example.com 1719852000000

If the preview isn't right, discard it and production never knew it existed:

surge discard example.com 1719852000000

A typical flow

surge --preview -m "redesigned pricing page"   # upload a candidate
# …check the preview URL, share it, run tests…
surge cutover example.com                       # ship it

This is also the natural shape for CI: every branch build publishes a preview, and merging to the main branch runs a plain surge (or a cutover). See CI & Automation.

For the full picture of how revisions work—rollback, rollfore, discard—see Revisions.