getting-started

Deploy on Netlify

Deploying Jekyll Site on Netlify

Prerequisites

  • GitHub/GitLab repository with Jekyll site
  • Netlify account

Deployment Steps

1. Connect Repository

  1. Log in to Netlify
  2. Click “New site from Git”
  3. Choose your Git provider
  4. Select repository

2. Build Configuration

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

# Environment
Ruby version: 3.2.2

3. Netlify Configuration File

Create netlify.toml in repository root:

[build]
  command = "bundle exec jekyll build"
  publish = "_site"

[build.environment]
  RUBY_VERSION = "3.2.2"

4. Deployment Script

# Sample deployment script
bundle install
bundle exec jekyll build

Continuous Deployment

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

Custom Domain

  1. Add custom domain in Netlify
  2. Configure DNS settings
  3. Enable HTTPS with Let’s Encrypt

Netlify Features

  • Form handling
  • Serverless functions
  • Split testing
  • Deploy previews

Troubleshooting

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

Best Practices

  • Use environment variables
  • Configure build caching
  • Set up deploy contexts