So after you have your code ready, how can you make it goes live on the internet so everyone can see it? In this post, I’ll show you the process of hosting your website on GitHub Pages.
GitHub Pages is a fast, easy, and free way to host your website. Before we dive into the process, it’s important to note that GitHub Pages hosts projects from a GitHub repository. With that said, let’s get started.
Create a GitHub Account If you don’t have a GitHub account already, go ahead and create one. It’s free to sign up, and you’ll need it to host your website.
Create a Repository Once you’ve created an account, you’ll need to create a new repository. If you make it public, it’s free. But if you prefer to keep it private, GitHub will charge you. Upload all your website files and click on the “Commit changes” button.
Set Up GitHub Pages GitHub Pages allows you to host your website for free. To do this, navigate to your repository settings and scroll down to GitHub Pages. In the “Source” drop-down menu, select the branch that contains the website code. Once you have specified the branch, click on the “Save” button.
Get a Domain Name Now that you’ve set up your GitHub account and created a repository, it’s time to get a domain name. You can purchase a domain name from a Domain Registrar like Namecheap, Matbao, and others.
Link Your Domain Name to GitHub Go to the Domain Registrar and add all the IPs provided by GitHub to the Value column, which means multiple rows of IPs. After finishing, go back to GitHub to set up the same thing.
Set up HTTPS for Secure Connection To ensure your website is secure, enable HTTPS. It is the method that encrypts all data flowing between the server and your browser. Enable HTTPS by checking the checkbox on GitHub, and wait for 15 minutes. Once finished, you should see a lock icon next to your domain name, indicating that it’s secure.
Adding a Subdomain When setting up a website, i.e. huynhproduct.webflow.io, “www” is generally considered a subdomain. You can set up a subdomain by entering the subdomain name at your Domain Registrar in the DNS record.