Set Up Preview Page

·view .md ↗·chatgpt ↗·claude ↗

To create your project's preview page, follow these steps:

  1. Create the preview branch:
    • In your GitLab repository, create a branch called: preview
    • Any changes you want to see in preview must be pushed to this branch.
  2. Configure the branch in Netlify
    1. Open your project in Netlify → Project configuration → Build & Deploy → Branches and deploy contexts → Configure
    2. Change Branch deploys to Let me add individual branches
    3. Type preview and press Enter
    4. Click Save
  3. Configure environment variables per context
    1. Go to Project settings → Environment variables
    2. Edit the APP_ENV variable to have different values per deploy context
    3. Configure as follows:
    ContextValue
    Productionproduction
    Deploys Previewpreview
    Branch Deployspreview
    Preview Server & Agent Runnersproduction
    Local Development (Netlify CLI)development
    1. Click Save variable
  4. Now, the next time you push to the preview branch, the Netlify deploy will start automatically.