Open navClose nav

GitHub Pages


This guide assumes you already have an existing Forestry Account, GitHub account, and a repository with a Jekyll or Hugo project. If you don’t have an existing project, check out our Quick start guide, which contains guides and resources for building your first static site.

Getting Started

To deploy a static site to GitHub pages using Forestry, you must first set up a new branch named gh-pages on your repo, which you can do by going to your repository in GitHub and using the branch management dropdown.,dpr_auto,f_auto,q_80,w_640/

Configuring Forestry

Once your new branch is created, navigate to the Settings page of your site in Forestry, click the Hosting tab, and set the Connection option to GitHub Pages.,dpr_auto,f_auto,q_80,w_640/ you haven’t authenticated with GitHub before, you’ll be prompted to choose “Public Repos” or “Private Repos”. Choose the option the applies to your repository.,dpr_auto,f_auto,q_80,w_640/

This will redirect you to GitHub, and prompt you to enter your login credentials if you are not already logged in.,dpr_auto,f_auto,q_80,w_640/

Give Forestry access to your GitHub repositories by clicking “Authorize application”. You can also request access to any GitHub organizations you are a member of.

In order to host a site with GitHub Pages, you will need admin permissions for the repository. This is because Forestry needs to add a web hook to your repository in order to watch for changes.

Once authorized, you will be redirected back to Forestry.,dpr_auto,f_auto,q_80,w_640/

Next, choose your repository, select the new gh-pages branch, and then click Save Settings.

From here on, every time you save or publish a page Forestry will build your site and deploy to this branch.

Enable GitHub Pages

To have GitHub pages begin serving from your new branch, go to the Settings page of your GitHub repository and scroll down to the GitHub Pages section.

Then select the branch that contains your built static site and click on the Save button.,dpr_auto,f_auto,q_80,w_640/

Your site should now be served at

Hugo CNAME file

With Hugo, ensure your CNAME file is in your /static directory. Otherwise, Hugo will delete your CNAME file when building your site. More details here: Trouble shooting CNAME files

Last updated on December 31, 2017