Host Your Website For Free With “GitHub-pages”
If you are looking for a way to host your portfolio website, project website, or your business website for free, this article is for you!
GitHub-pages is a feature provided by GitHub to deploy your static websites. (Here I’m not going to discuss Git basics)
There are two types of GitHub pages.
1. User or organization sites
The site URL will be
https://[username].github.io
Files are kept in a special repository dedicated to the Github pages website.
2. Project sites
The site URL will be
https://[username].github.io/[RepositoryName]
These sites are connected to a specific branch of the project repository.
Benefits
Websites deployed on Github can be managed easily with basic GitHub features. GitHub automatically builds and deploys them for you.
“Our team of experts goes beyond industry standards to secure our platform.”
As GitHub itself says, Github is a secure way to keep and manage our source code.
Enabling GitHub pages
- All you need is a GitHub account.
- Create a project repository. (If you are creating a user site or an organization site, the repository name should be
[username].github.io
) - People are used to creating a separate branch (
gh-pages
) when creating a project site. - Go to repository -> settings -> GitHub Pages
- Select the source branch to build Github pages (If a project repository). User pages must be built from the
master
branch. - Additionally, with a GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server accounts, users can keep their repositories private, while enabling GitHub-pages
- Students may apply for “GitHub Student Developer Pack” which gives GitHub Pro features for free.
- To make the story brief, you can create an index.html file in the relevant branch of the repository with some test code.
- Go to the site URL (as discussed above) — You can see the website alive after GitHub finishes building the project.
- Manage your site as a usual git project.
*Bonus
If you are willing to add a custom domain name you already own for your website,
- Go back to the repository -> settings -> GitHub Pages.
- Add your custom domain in the custom domain field and save.
- Configure DNS server settings with your custom domain and Github-page site.
- After successfully completing the configuration, check “Enforce HTTPS” for additional security (optional).
Make use of GitHub pages. Save some money.
Thank you for reading!