Skip to main content
Cloudflare Pages is a hosting platform used by millions of websites. It provides a global CDN, DDoS protection, and a generous free tier. This guide walks through connecting your GitHub repository to Cloudflare Pages and deploying your Retype site.

Prerequisites

  • A GitHub repository containing your Retype project source files
  • The Retype Build Action configured to publish built output to a retype branch (see the GitHub Actions guide)
  • A Cloudflare account (free tier is sufficient)

Deployment

1

Add the Retype Build Action

Before connecting Cloudflare Pages, set up the Retype GitHub Build Action in your repository. The action builds your site and pushes the output to a retype branch, which Cloudflare Pages will serve.
Complete this step and verify the retype branch exists in your repository before proceeding. Cloudflare Pages requires the branch to be present when you configure the project.
2

Sign up for Cloudflare

Go to cloudflare.com and click Sign up in the top-right corner. Follow the registration prompts.After signing up, you will have access to your Cloudflare dashboard.
3

Create a new Pages project

  1. In the Cloudflare dashboard, scroll down to the Pages section in the left sidebar and click it.
  2. Click Create a project.
  3. Click Connect to Git.
  4. Authorize Cloudflare to access your GitHub account and select your repository.
4

Configure build settings

On the Set up builds and deployments screen, configure the following:
SettingValue
Project nameYour preferred name (this becomes the default pages.dev subdomain)
Production branchretype
Build command(leave blank — the branch already contains built output)
Build output directory/
If you prefer Cloudflare to build the site instead of using the pre-built retype branch, set the build command to retype build and the output directory to .retype. You will also need to install Retype as part of the build — see the Docker guide for an example of installing Retype in a build environment.
5

Set environment variables (if using a Retype license key)

If your project requires a Retype license key:
  1. Expand the Environment variables (advanced) section on the build settings screen.
  2. Click Add variable.
  3. Set the variable name to RETYPE_KEY and the value to your license key.
Retype automatically reads the RETYPE_KEY environment variable during the build.
6

Save and deploy

Click Save and Deploy. Cloudflare Pages will deploy your site within a few moments. Once complete, your site will be available at <project-name>.pages.dev.

Custom domain

To use a custom domain with your Cloudflare Pages site:
1

Add a custom domain

In the Cloudflare Pages dashboard, open your project and go to the Custom domains tab. Click Set up a custom domain and enter your domain name.
2

Configure DNS

If your domain is already managed by Cloudflare, the DNS record is added automatically. If your domain is registered elsewhere, follow the prompts to add the required CNAME record at your DNS provider.
3

Update retype.yml

Update the url in your retype.yml to your custom domain:
retype.yml
url: docs.example.com

Other hosting options

GitHub Pages

Deploy to GitHub Pages for free using the Retype Build Action.

Netlify

Deploy to Netlify with automatic builds from your Git repository.

Docker

Run Retype in a Docker container for flexible self-hosted deployments.