Git Integration
Cloudflare supports connecting Cloudflare Workers to your GitHub and GitLab repositories to look for new changes to your Worker. Workers does not currently support self-hosted instances of GitHub or GitLab, but you can use wrangler deploy
with an external CI/CD provider.
You can deploy projects to Cloudflare Workers from your open-source team, company, or side project on both GitHub and GitLab.
When authorizing Cloudflare Workers to access a GitHub account, you can specify access to your individual account or an organization that you belong to on GitHub.
To add Cloudflare Workers installation to an organization, your user account must be an owner or have the appropriate role within the organization (i.e. the GitHub Apps Manager role). More information on these roles can be seen on GitHub’s documentation ↗.
By authorizing Cloudflare Workers to access your GitLab account, you will automatically allow access to organizations, groups, and namespaces your GitLab account can access for use by Cloudflare Workers. Managing access to these organizations and groups is handled by GitLab.
You can remove Cloudflare Workers’ access to your GitHub account by viewing the Applications page ↗ on GitHub. The GitHub App is named Cloudflare Workers and Pages, and it is shared between Workers and Pages projects.
Note that removing access to GitHub will disable new builds for Workers and Pages, though the last build of your project will continue to be hosted via Cloudflare Workers.
You can remove Cloudflare Workers’ access to your GitLab account by navigating to User Settings > Applications > Authorized Applications. Find the applications called Cloudflare Pages and select the Revoke button to revoke access.
Note that the GitLab application Cloudflare Pages is shared between Workers and Pages projects, and removing access to GitLab will disable new builds for Workers and Pages, though the last build of your project will continue to be hosted via Cloudflare Workers.
When encountering Git integration related issues, one potential troubleshooting step is attempting to uninstall and reinstall the GitHub or GitLab application associated with the Cloudflare Workers & Pages installation. The process for each Git provider is provided below.
- Go to the installation settings page on GitHub:
https://github.com/settings/installations
for individual accounts.https://github.com/organizations/<YOUR_ORGANIZATION_NAME>/settings/installations
for organizational accounts.
- If the Cloudflare Workers and Pages installation is there, click Configure, and click Uninstall “Cloudflare Workers and Pages” (if there is no “Cloudflare Workers and Pages” installation, then no action is needed)
- Go back to the Workers & Pages overview page. Select a Worker, then go to Settings > Build.
- In the Build settings, either select the GitHub button to establish a GitHub connection, or select Connect then go to the Git Account dropdown and select + New GitHub Connection
- Click the + Add account button, click the GitHub account you want to add, and then click Install & Authorize.
- You should be redirected to the create project page with your GitHub account or organization in the account list.
- Attempt to make a new deployment with your project which was previously broken.
- Go to your application settings page on GitLab located here: https://gitlab.com/-/profile/applications ↗
- Click the “Revoke” button on your Cloudflare Pages installation if it exists.
- Go back to the Workers & Pages overview page. Select a Worker, then go to Settings > Build.
- In the Build settings, either select the GitLab button to establish a GitLab connection, or select Connect then go to the Git Account dropdown and select + New GitLab Connection
- You should be redirected to the create project page with your GitLab account or organization in the account list.
- Attempt to make a new deployment with your project which was previously broken.