getting-started
Deploy on Netlify
Deploying Jekyll Site on Netlify
Prerequisites
- GitHub/GitLab repository with Jekyll site
- Netlify account
Deployment Steps
1. Connect Repository
- Log in to Netlify
- Click “New site from Git”
- Choose your Git provider
- 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
- Add custom domain in Netlify
- Configure DNS settings
- 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