Open navClose nav

GitHub Pages

Forestry will stop building and deploying sites on January 1st, 2020.
Read the deployment sunset notice.

This guide assumes you already have an existing Forestry Account, GitHub account, and a repository with a 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 Deployment tab, and set the Connection option to GitHub Pages.,dpr_auto,f_auto,q_80,w_640/

Click on “Click here to edit repo & branch” to connect your new gh-pages branch with Forestry.,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

Using a Custom Domain

If you want to use a custom domain with GitHub Pages, you will need to include a CNAME file containing your custom domain. The CNAME file should instead be added to your source files, in a location where it will be copied to the generated site. In the case of a Hugo site, this should be in your static/ directory, while it can live in the root of your project if you’re using Jekyll.

If you manually add this file to your gh-pages branch, it will be deleted the next time Forestry deploys your site.

GitHub Help: Using a Custom Domain With GitHub Pages

Forestry: Troubleshooting CNAME files

Last updated on December 12, 2018