Skip to main content
With previews, every pull request on GitHub gets its own deployment with its own URL. Reviewers can click through the change before it’s merged, and production doesn’t change until you merge. Previews are on paid plans, for projects deployed from GitHub.

Requirements

There’s nothing to switch on. Once these are true, opening a pull request against the project’s repository creates a preview.

How it works

1

Open a pull request

Open a pull request against the branch your project deploys, such as main.
2

Pxxl builds it

Pxxl builds the pull request’s latest commit through the same pipeline as production, starting from the production branch’s build cache.
3

Get the URL

The preview goes live at its own random address. On GitHub, the pull request shows the deployment and a Pxxl commit status, with a link to the preview.
4

Push more commits

Each new commit on the pull request redeploys the same preview, at the same URL.
5

Merge or close

When the pull request is merged or closed, Pxxl stops the preview, removes its URL and deletes its build cache. A merge then deploys to production like any push.
A project’s previews show in its Overview, and their builds and logs on its Deployments tab.

Promote a preview to production

When a preview looks right, ship exactly what you checked. Promote to production on the preview’s card merges its pull request on GitHub, at the commit the preview was built from. That merge is a push to your production branch, so production then deploys it like any other push: through Wait for CI, the pre-deploy command and your health check. Pxxl doesn’t deploy anything itself when you promote.
A pull request preview card in the project Overview, marked deployed, with a Promote to production button.
1

Open the project's Overview

Each open pull request has a card with its title, branch and preview URL.
2

Choose Promote to production

The panel names the pull request and the branch it merges into.
3

Pick how to merge

Squash and merge, Create a merge commit or Rebase and merge: the methods your repository allows on GitHub. Squash is the default when it’s allowed.
4

Merge and deploy

Choose Merge #N and deploy. The pull request is merged as Pxxl’s GitHub App and the preview closes. Follow the production deployment in the Deployments tab.
The Promote to production panel: Pxxl will merge pull request #4 into the production branch at the commit this preview built, with the merge method and a Merge #4 and deploy button.

When you can’t promote

The button stays off and says why. Fix it on GitHub, then come back:
A preview card with Promote to production turned off and the reason: Pull request #4 is a draft, with a link to open it on GitHub.
Promoting needs the same team permission as redeploying the project. Each promotion is recorded in the project’s activity.

Turn previews on or off

Previews follow Settings > Deployments > Auto-deploy: when a project deploys on push, its pull requests get previews. Turn Auto-deploy off and neither pushes nor pull requests deploy. A preview starts when a pull request is opened, reopened, marked ready for review, or gets a new commit.

Variables in previews

A preview doesn’t get your production variables by default. A pull request can come from anyone who can push to the repository, and you don’t want its code to reach your production database or payment keys. Instead, previews get the project’s preview variables. Add them in the Secrets tab under Preview Variables, with test values such as a staging DATABASE_URL or a test API key.
The Preview Variables panel in a Pxxl project's Secrets tab.
If you trust everyone who opens pull requests and want previews to use the production values, turn on Settings > Deployments > Sync PR previews with project variables. More: Environment variables.

Pull requests from forks

A pull request from a fork, by someone who isn’t an owner, member or collaborator on the repository, isn’t built straight away. It waits for your approval, and you get a notification: PR #N preview needs your approval. In the project’s Overview, the preview shows needs approval. Read the change, then choose Approve and build. Every new commit on a fork’s pull request needs approval again. That way, nobody outside your team can run code on your account or read your preview variables without you looking first.

Protect previews

To keep previews private, turn on password protection in Settings > Protection and choose Preview only. Visitors to a preview then need the password, while production stays public. Plus and up.

Limits

  • 5 open previews per project. A sixth pull request’s preview is held with preview limit. Close a preview or merge a pull request, then choose Try again on the held one.
  • Idle previews close after 30 days. A preview with no new commits for 30 days is stopped.
  • Preview builds use your plan’s build minutes, like any build.
  • Previews are for GitHub projects. GitLab, Pxxl Drop, Docker and CLI projects don’t get them.

If a preview doesn’t appear

Check that the project is on a paid plan, deploys from GitHub, and has Auto-deploy on. Check that the project doesn’t already have 5 open previews.
The pull request comes from outside your team. Choose Approve and build on its card.
Previews use preview variables by default. Add the variables it needs on the Secrets tab, or turn on Sync PR previews with project variables.

Previews from the CLI

Without GitHub, you can get a similar flow by deploying a branch to a second project:
Give it its own variables with pxxl env push, and promote by deploying the same code to your main project.