Rift Logo RiftJS

Deploying Rift to Cloudflare Pages

Cloudflare Pages is one of the fastest and most reliable ways to deploy your Rift site. It offers edge-hosted static delivery, free HTTPS, automatic Git integration, and zero-config deployment.

Prerequisites

  • A Rift project pushed to a Git provider (GitHub, GitLab)
  • A working package.json with:
    • "build": "rift build" defined in scripts
  • Output directory set to dist/

Steps

1. Push Your Code to GitHub

Make sure your Rift project is in a Git repo and pushed to GitHub (or GitLab).

You only need the source files — src/, package.json, etc. No need to commit dist/.

2. Go to Cloudflare Pages

Visit pages.cloudflare.com and click “Create a project”. Connect your GitHub or GitLab account and choose your Rift repository.

3. Configure Build Settings

In the project setup:

  • Framework preset: None
  • Build command: npm run build
  • Output directory: dist

Cloudflare will install dependencies, run your build, and deploy the static files in dist/.

4. Click Deploy

Once settings are saved, hit Deploy Site. Your site will be built and published to a *.pages.dev subdomain within a minute or two.

5. (Optional) Add Custom Domain

Go to your Pages project → Settings → Custom Domains. Add your domain (e.g. riftssg.com) and point DNS to Cloudflare or update your registrar. Free HTTPS and auto-renewing SSL is included.

Verify

After deployment:

  • Visit your site at the generated .pages.dev domain
  • Check that pages, permalinks, and 404.html work as expected
  • Confirm static assets are being served correctly

Continuous Deployments

Every time you push to your main branch, Cloudflare will rebuild and redeploy your site automatically. You can also use preview branches to test features without affecting production.

Summary

Setting Value
Framework preset None
Build command npm run build
Output directory dist
Default domain *.pages.dev
Free HTTPS ✅ Yes
Auto redeploys ✅ Yes