Cloudflare supports connecting your GitLab repository to your Cloudflare Worker, and will automatically deploy your code every time you push a change.
Beyond automatic builds and deployments, the Cloudflare GitLab integration lets you monitor builds directly in GitLab, keeping you informed without leaving your workflow.
If a commit is on a merge request, Cloudflare will automatically post a comment on the merge request with the status of the build.
A Preview URL will be provided for builds which perform wrangler preview. This is useful when reviewing your merge request, as it lets you test the code changes in an isolated copy of your Worker.
Subsequent pushes to the same branch update the same Preview URL. Each deployment also gets an immutable Deployment URL for testing one exact deployment.
The comment lists URLs for every host enabled for Previews on your Worker. This can be a custom domain, workers.dev, or both. A custom domain alone is enough.
If the comment shows No Preview URL for a successful build, refer to Troubleshooting.
If you have one or multiple Workers 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, you can 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 build on the Cloudflare Dashboard.
Note that when using build watch paths, only projects that trigger a build will generate a commit status.
You can deploy projects to Cloudflare Workers from your company or side project on GitLab using the Cloudflare GitLab integration.
When you authorize Cloudflare Workers to access your GitLab account, you automatically give Cloudflare Workers 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 Workers' access to your GitLab account by going to the Authorized Applications page ↗︎ on GitLab. Find the application called Cloudflare Workers (or Cloudflare Pages) and select Revoke to revoke access.
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 will continue to be hosted by Cloudflare.
-
Go to your application settings page on GitLab at GitLab Authorized Applications ↗︎.
-
Select Revoke on your Cloudflare Workers (or Cloudflare Pages) installation if it exists.
-
In the Cloudflare dashboard, go to the Workers & Pages page.
Go to Workers & Pages ↗ -
Select Create application > GitLab.
-
Select + Add account, choose the GitLab account you want to add, and select Install & Authorize.
-
You will be redirected to the create project page with your GitLab account or organization in the account list.
-
Trigger a new deployment for the affected project.