Jekyll & Netlify: Deploy a website from GitHub
Drag-and-drop deployment is good enough if you don’t update your website often. However, it becomes annoying to build your static website locally and upload it to Netlify manually, if you do it every day. Fortunately, you can automate the website publishing by connecting Netlify website container to the project repository. For existing website follow this instruction:
- Open the website dashboard. You need to get to the Continuous Deployment section. Follow Settings → Build & deploy or Deploys → Deploy settings;
- Under Build settings title press Link site to Git button;
- Choose GitHub option and follow authorization instructions;
- Select repositories you would like to share with Netlify and press Save;
- You’ll get back to the Git linking interface with available repositories list. Choose the repository you would like to connect;
Submit those deploy setting values:
- Pick branch to deploy: master or your production branch;
JEKYLL_ENV=production jekyll build;
- Publish directory: _site;
Wait a bit for your website to get fetched and built. Once it’s finished,
you’ll see Published status next to the deploy ID.
If you’ve got Failed deploy status, click on the deploy link and check its logs to see a more descriptive error message.
Also, you can publish a new website from the GitHub repository. In your Netlify dashboard press the New site from Git button and follow the same steps (starting from the 3rd one) described above.