Deploy on GitHub Pages
These instructions are for GH Users. Other CollectionBuilder types rely on Jekyll plugins, thus will not build properly using default GitHub Pages–see GitHub Actions for an alternative. Also note that GH users can use any deployment method–you are not limited to using GitHub Pages to host your site!
Make Repository Public
Your repository must be public to use GitHub Pages unless you have a paid account (most users make their projects public anyway!). If your project is not already public:
- On your project repository’s home page, click the “Settings” button (appears on the right along the tabs above the code area).
- Scroll down to the red box at the bottom and click the “Change visibility” option.
Activate GitHub Pages
- On your project repository’s home page, click the “Settings” button (appears on the right along the tabs above the code area).
- On “Settings” page: click “Pages” in the left side menu.
- On the “Pages” page: under “Source” leave the dropdown button as “Deploy from a branch”. Under “Branch” use the dropdown to change from “none” to “main” (leave the folder option as “/root”), then click the “Save” button.
It will take a few minutes for the build to happen and your site to go live–so wait it out! After a few minutes, refresh the “Pages” page. If the build is successful, an alert will appear near the top providing the URL to your live site. The URL will follow the pattern: “https://username.github.io/repository-name”
For convenience, you might want to copy the URL to display on your home page:
- Copy the provided URL.
- Go to repository’s home page.
- On right side of the code area, look for “About” section and click on the cog icon to edit.
- In the “About” box, paste in your URL, then click “Save”. This will make it easy to access the site in the future!
Congratulations! Your site is now live. You can now move on to the Advanced Topics section.
Turn Off GitHub Pages
Sometimes you may want to take down a live site, for example if you were just using it for a demo or prototype and want to deploy a new version somewhere else. GitHub Pages is just as easy to turn off as it is to activate:
- On your project repository’s home page, click the “Settings” button (appears on the right along the tabs above the code area).
- On “Settings” page: click “Pages” in the left side menu.
- On the “Pages” page: under “Branch” section, change the dropdown button to “none”, then click the “Save” button.
After deactivating GitHub Pages, visiting the old URL will result in an 404 page. Keep in mind that the repository still contains all the code–so you can always turn it back on!