Creating a free website on GitHub
- Log in to GitHub https://github.com/login
- Create a new repository
- Click the top-right + (plus) button
- Or go to https://github.com/new
- Name the repository whatever you want, like
- mywebsite or testing
- Create a file (or upload one you have)
- Click the
creating a new file
link:
- Click the
- Name the file
index.html
- Add something to the file (like ‘Hello’)
- Click the green button Commit to Save the file (at the bottom)
Now we have created a file with some content in a repository.
Enabling GitHub pages
Next we need to tell GitHub we want this repository to be a website!
- Click the Settings tab for your repository
- Scroll down until you find the GitHub settings
- Enable GitHub pages by clicking the None dropdown and selecting master branch (first option) *
- GitHub will now enable your page.
- Scroll down again so you can see the link to your website
Thats it! Congratulations on your very own website!
Next steps (optional)
- Learn HTML
- https://www.w3schools.com/html/
- https://www.codecademy.com/learn/learn-html
- Learn CSS
- https://www.w3schools.com/css/
- Learn JavaScript
Using a custom domain (advanced)
In the GitHub Settings you can also add your own domain like mydomain.com
You need to have:
- Bought a domain!
- Pointed the DNS records to GitHub pages
- https://help.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site
- On the website you bought your domain:
- Create an A record pointing to any of these IPs:
- 185.199.108.153
- 185.199.109.153
- 185.199.110.153
- 185.199.111.153