Deploy to pages specifying production or preview from a gitlab CI/CD pipeline

We have a CI/CD pipeline that publishes our repo to cloudflare pages from a private gitlab, however I want to be able to select preview or production using gitlab, not the default system where it uses preview builds for extra branches until you merge into main.

How do i achieve this? Is there a way to pass an environment variable from gitlab to cloudflare pages to specify which environment to publish to preview or production?
Was this page helpful?