Deploying your Jekyll site on Netlify is an excellent way to ensure your website updates automatically whenever you push changes to your repository. This process, known as continuous deployment, streamlines your workflow and keeps your site current without manual intervention.

Prerequisites for Deployment

  • A GitHub, GitLab, or Bitbucket repository containing your Jekyll site source code.
  • A Netlify account. You can sign up for free at https://www.netlify.com/.
  • Basic knowledge of Git and command line operations.

Setting Up Your Jekyll Site Repository

Ensure your Jekyll site is stored in a Git repository. Your repository should include all necessary files, such as _config.yml, _posts, and your layout and asset folders. Confirm that your site builds correctly locally using the command bundle exec jekyll build.

Connecting to Netlify

Log in to your Netlify account and click on the “New site from Git” button. Choose your repository hosting service and authorize Netlify to access your repositories. Select the Jekyll repository you want to deploy.

Configure Build Settings

  • Branch to deploy: usually main or master.
  • Build command: bundle exec jekyll build.
  • Publish directory: _site.

After entering these settings, click “Deploy site.” Netlify will now build and deploy your Jekyll site automatically whenever you push updates to your repository.

Additional Tips for Smooth Deployment

  • Ensure your _config.yml is configured correctly for production.
  • Add a Gemfile with all necessary dependencies, including jekyll.
  • Use environment variables in Netlify for sensitive data like API keys.
  • Test your build locally before deploying to catch errors early.

Conclusion

Deploying your Jekyll site on Netlify with continuous deployment simplifies updates and ensures your website is always up-to-date. With a few configuration steps, your site will automatically rebuild and deploy every time you make changes, saving you time and effort.