getting-started

Deploy on Cloudflare Pages

Deploying Jekyll Site on Cloudflare Pages

Prerequisites

  • GitHub/GitLab repository with Jekyll site
  • Cloudflare account

Deployment Steps

1. Prepare Your Repository

  • Ensure Gemfile and build scripts are in the repository
  • Add build command in repository

2. Cloudflare Pages Setup

  1. Log in to Cloudflare
  2. Navigate to Pages
  3. Connect to Git Provider

3. Configuration

# Build settings
Build command: bundle exec jekyll build
Output directory: _site

# Environment
Ruby version: 3.2.2

4. Deploy Configuration

# Sample deployment script
bundle install
bundle exec jekyll build

Continuous Deployment

  • Automatic builds on every push
  • Preview deployments for pull requests

Custom Domain

  1. Add custom domain in Cloudflare Pages
  2. Configure DNS settings
  3. Enable HTTPS

Troubleshooting

  • Check build logs
  • Verify Ruby and Jekyll versions
  • Ensure all dependencies are in Gemfile

Best Practices

  • Use environment variables
  • Configure build caching
  • Set up branch deployments