Deploying to Cloudflare Workers with Linc
Where can I configure deployments to Cloudflare Workers?
- When first creating a Site
- From the Deploy section of your Site's settings
What do I need to configure deployments?
Once you've copied the Account ID, jump over to Linc and paste it into the Account ID section of the Cloudflare Workers deploy config form.
To get a Cloudflare Workers API Token, head over to your Cloudflare Workers Dash.
From there, click the Get your API token link under CLI and API the section:
From your API Tokens page, click the Create Token button.
Then, from the list of available API Token Templates select the Edit Cloudflare Workers template:
Configuring the Cloudflare Workers template
Once you've selected the Cloudflare Workers template from the API Token Templates list, you'll be navigated to a form where you can edit the selected template. We'll need to make a couple of minor adjustments to this template.
Under the Permissions section, click+ Add More to add a new permission, then set the new permission as follows:
Then, under the Account Resources section, set the fields to: Include - [Your Account]:
Finally, under the Zone Resources section, set the fields to: Include - All Zones from an account - [Your Account]:
With that, your form should now look something like this:
Hit the button Continue to summary then click the Create token button. You can then copy the newly generated API token from the prompt:
With your new API Token in hand, head back to Linc and paste it into the API Token section of the Cloudflare Workers deploy config form.
Linc will automatically validate the API token against Cloudflare when you paste it into the API Token field.
If the token is valid, you can proceed with completing the remainder of the config form.
Configuring a Deployment Target
The final section of the config form allows you to enable deployments to the following targets:
- Your personal workers.dev subdomain
- One of your production domains
Deploying to workers.dev
If you're deploying to your workers.dev subdomain, check the Use a 'workers.dev' subdomain checkbox and then type in a preferred subdomain into the subdomain field.
Deploying to a Production Domain
If you want to deploy to one of your production domains, check the Use one of my production domains checkbox, then select a desired production domain from the available list. You can also optionally enter a subdomain.
Once you've completed the Deployment Targets section, your Cloudflare Workers deployment config should be complete!
For help setting up, please get in touch