
Step 1: Clone the starter project
Step 2: Create your Doppler project
Step 3: Add your secrets to Doppler
Step 4: Cloudflare local development with Doppler
Step 5: Deploy the application and sync secrets to Cloudflare
Step 6: Set up GitHub Actions for CI/CD
Step 7: Rotating secrets
Step 8: Team collaboration
Troubleshooting common issues
What you've accomplished
Manual deployments work for occasional updates, but they don't scale. Every time you push code, you need to remember to sync secrets. If a team member deploys without syncing, secrets could get out of date. And there's no record of who deployed what or when.
To solve this, all we need to do is create a GitHub Actions workflow. Once the Worker is created, the workflow will automatically fetch the latest secrets from Doppler, update them in Cloudflare, and deploy the Worker whenever you push code.
You've been using the Doppler CLI with your personal login, which works for interactive use. For automated systems like GitHub Actions, you need a service token instead.
Service tokens are scoped to a single environment(like production) and provide read-only access to secrets. If a token is compromised, an attacker can read secrets but can't modify them or access other environments. This principle of least privilege is important for CI/CD security.
To proceed, generate a token for your production configuration:
Save the output somewhere secure. You'll add it to GitHub in a moment.
Next, go to the API Tokens page in your Cloudflare dashboard and click Create Token. Select the Edit Cloudflare Workers template, as shown in the image below, then generate and save the token.

After selecting the template, generate the token and copy it somewhere safe for now. You will need it shortly.
You'll also need your Cloudflare account ID. You can find it on the account home page by clicking the three-dot menu next to your email address, as shown below.

Now that you have all three values, add them as repository secrets. In your GitHub repository, go to Settings > Secrets and variables > Actions, then click "New repository secret" to add each of the following:
Next, create a new GitHub Actions workflow at .github/workflows/deploy.yml. This file will define the steps used to build and deploy your Worker automatically on each deployment.
Now, every push to your main branch automatically installs dependencies, pulls secrets from Doppler using the service token, syncs those secrets to Cloudflare, and deploys the Worker. This eliminates manual steps, forgotten secret syncs, and uncertainty about whether production has the latest credentials. Every deployment is consistent and fully auditable.
For more sophisticated setups, you may want separate staging and production deployments driven by different branches. The expanded workflow below deploys automatically based on the branch that was pushed.
With this setup, staging and production are cleanly separated while still being fully automated through the same pipeline. Each environment uses its own configuration, secrets, and deployment target, reducing the risk of accidental cross-environment changes.
Trusted by the world’s best DevOps and security teams. Doppler is the secrets manager developers love.
