A basic splash page for testing out the GitHub Pages feature (free hosting).
This page is available to view at
https://codeadamca.github.io/github-pages-deploy-html/
[GitHib Pages] allows you to deploy your static HTML, JavaScript, and CSS pages to a GitHub or custom domain. To deploy a repository follow these steps:
-
Create a new standard repository, let's assume it's named
github-pages
:- Give the repo the name
github-pages-deploy-html
- Give the repo a brief description
Deploying a static page using GitHub Pages.
- For the rest, just leave the defaults
- Click
Create repository
- Give the repo the name
-
Using the terminal clone the repo:
git clone https://github.com/codeadamca/github-pages-deploy-html
-
Open the new
github-pages-deploy-html
folder using your IDE of choice. I use Visual Studio Code. Add anindex.html
and add some basic HTML content:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>GitHub Pages</title> </head> <body> <h1>Hello GitHub Pages!!</h1> </body> </html>
-
Push the changes to your GitHub repo:
git add . fit commit -m "Added home page" git push origin main
-
Using the browser, navigate back to
githib-pages-deploy-html
repo, click on thesettings
tab, and thenPages
. -
Choose
Deploy from branch
, the branch name and folder you want to deploy, then click save: -
Wait for a minute or two and then the GitHub URL will be functional. The URL will be:
http://<REPO_NAME>.<GITHUB_USERNAME>.ca/
You can use a custom domain (or subdomain) you have registered from a domain name provider.
Go back to the repo settings and choose Pages
. Enter the custom domain, choose whether or not to Enforce HTTPS
, and click Save
:
Log in to your domain name provider and navigate to your domain name DNS settings. Add four A records pointing the domain to GitHub:
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
In my domain name provider the settings looks like this:
For more information on setting up your custom doamin checkout the GitHub Documentation.