Skip to main content
To enable GitHub Actions to deploy your microfeed instance to Cloudflare, you need to add five secrets to your forked repository. These secrets contain your Cloudflare credentials and configuration. Go to your forked repository’s Settings → Secrets and variables → Actions, then click “New repository secret” to add each of the following secrets.

Required secrets

CLOUDFLARE_ACCOUNT_ID

Your Cloudflare account ID is found in your dashboard URL.
1

Log in to Cloudflare

Go to https://dash.cloudflare.com/login and sign in to your account.
2

Find your account ID

After logging in, you’ll be redirected to a URL like:
https://dash.cloudflare.com/fff88980eeeeedcc3ffffd4f555f4999
The last part of the URL is your account ID.
3

Add the secret

In GitHub, create a new secret named CLOUDFLARE_ACCOUNT_ID and paste your account ID as the value.
CLOUDFLARE_ACCOUNT_ID example

CLOUDFLARE_API_TOKEN

You need to create an API token with permissions for Cloudflare Pages and D1.
2

Create a custom token

Click “Create Token” and select “Create Custom Token”.Create custom token
3

Set permissions

Configure the token with edit permissions for both:
  • Cloudflare Pages
  • D1
Token permissions
4

Copy the token

After creating the token, copy it immediately as you won’t be able to see it again.Copy API token
5

Add the secret

In GitHub, create a new secret named CLOUDFLARE_API_TOKEN and paste the token as the value.

R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY

These credentials allow microfeed to store and retrieve media files from Cloudflare R2.
1

Navigate to R2 dashboard

Go to your R2 dashboard.
You may need to add a credit card to access R2, but you won’t be charged unless you exceed the very generous free quota (10GB storage + 10 million reads/month + 1 million writes/month).
2

Create an API token

Click “Manage R2 API Tokens” and then “Create API Token”.Create R2 token
3

Select permissions

Choose “Admin Read & Write” permission and create the token.R2 permissions
4

Copy both credentials

After creating the token, you’ll see two values:
  • Access Key ID: Copy this for R2_ACCESS_KEY_ID
  • Secret Access Key: Copy this for R2_SECRET_ACCESS_KEY
Copy R2 credentials
5

Add both secrets

In GitHub, create two secrets:
  • R2_ACCESS_KEY_ID with the Access Key ID
  • R2_SECRET_ACCESS_KEY with the Secret Access Key

CLOUDFLARE_PROJECT_NAME

This is the name that will be used for your Cloudflare Pages project.
1

Choose a project name

Pick a name using only these characters:
  • Lowercase letters: a-z
  • Uppercase letters: A-Z
  • Numbers: 0-9
  • Dashes: -
Do not use underscores (_), spaces, or other special characters. Cloudflare Pages won’t accept them.
2

Use your domain name

We recommend using your custom domain name with dots replaced by dashes.For example:
  • Domain: photos.mycustomdomain.com
  • Project name: photos-mycustomdomain-com
3

Add the secret

In GitHub, create a secret named CLOUDFLARE_PROJECT_NAME with your chosen project name.

Verify your secrets

After adding all five secrets, your GitHub Actions secrets page should look like this: All secrets configured

What’s next

With all secrets configured, you’re ready to run the GitHub Action workflow to deploy your microfeed instance to Cloudflare.

Build docs developers (and LLMs) love