You can connect each Cloudflare Pages project to a GitLab repository, and Cloudflare will automatically deploy your code every time you push a change to a branch.
Beyond automatic deployments, the Cloudflare GitLab integration lets you monitor, manage, and preview deployments directly in GitLab, keeping you informed without leaving your workflow.
Pages defaults to setting your production environment to the branch you first push. If a branch other than the default branch (for example, main) represents your project's production branch, go to Settings > Build > Branch control, select the Production branch dropdown menu, and choose the desired branch.
You can also use preview deployments to preview versions of your project before merging your production branch and deploying to production. Pages allows you to configure which of your preview branches are automatically deployed using branch build controls. To configure this, go to Settings > Build > Branch control and select an option under Preview branch. Use Custom branches to specify branches to include or exclude from automatic preview deployments.
Without any configuration required, you can choose to skip a deployment on an ad hoc basis. By adding the [CI Skip], [CI-Skip], [Skip CI], [Skip-CI], or [CF-Pages-Skip] flag as a prefix in your commit message, Pages will omit that deployment. The prefixes are not case sensitive.
If you have one or multiple projects connected to a repository (for example, a monorepo), you can check on the status of each build within GitLab via GitLab commit status ↗︎.
You can view the statuses by selecting the status icon next to a commit or by going to Build > Pipelines within your GitLab repository. In the following example, select the green check mark to view the results of the check run.
Check runs will appear like the following in your repository. You can select one of the statuses to view the preview URL for that deployment.
If a build skips for any reason (for example, CI Skip, build watch paths, or branch deployment controls), the check run or commit status will not appear.
You can deploy projects to Cloudflare Pages from your personal account or group on GitLab using the Cloudflare GitLab integration.
You can deploy projects to Cloudflare Pages from your personal account or organization on both GitHub and GitLab.
When you authorize Cloudflare Pages to access your GitLab account, you automatically give Cloudflare Pages access to organizations, groups, and namespaces accessed by your GitLab account. Managing access to these organizations and groups is handled by GitLab.
You can remove Cloudflare Pages' access to your GitLab account by going to the Authorized Applications page ↗︎ on GitLab. Find the application called Cloudflare Pages (or Cloudflare Workers) and select Revoke.
The GitLab application is shared between Workers and Pages projects. Removing access to GitLab disables new builds for both Workers and Pages, though your previous deployments continue to be hosted by Cloudflare.
When encountering Git integration issues, uninstall and reinstall the GitLab application associated with your Cloudflare account.
-
Go to the Authorized Applications page ↗︎ on GitLab.
-
Select Revoke on your Cloudflare Pages (or Cloudflare Workers) installation if it exists.
-
In the Cloudflare dashboard, go to the Workers & Pages page.
Go to Workers & Pages ↗ -
Select Create application (if prompted), select the link at the bottom of the page to continue to Cloudflare Pages (Get started or Continue to Pages), and select Import an existing Git repository.
-
Select the GitLab tab, select + Add account, choose the GitLab account you want to add, and select Authorize on the confirmation prompt.
-
You will be redirected to the create project page with your GitLab account or organization in the account list.
-
Trigger a new deployment with your previously affected project.