HagiCode Fullstack

Publier avec GitHub Pages

Draft: this lesson is an outline and will be expanded.

GitHub Pages is the simplest way to put a website online: GitHub shows the files of your repository as a website. At the end of this lesson your site has a public address that looks like your-name.github.io, and you can send it to a friend.

A repository is the folder on GitHub that holds your project and its history. You created one in the GitHub course.

What you will do

  1. Make sure your website project is in a repository on GitHub, and that your latest changes are pushed. Use GitHub Desktop, as in the GitHub course.
  2. Ask your AI assistant: “I want to publish this site with GitHub Pages. Tell me which setting to turn on in my repository and which folder GitHub should read.” Read the answer, and compare it with what GitHub currently shows on its settings page.
  3. Turn the setting on. Follow the instructions on the GitHub page itself, because the wording of the settings can change.
  4. Wait a few minutes, then open the address that GitHub shows. The first publication can take a little while.
  5. Open the address on your phone as well, and look at how the page appears.
  6. Change one word in the site, commit and push the change, wait, and reload to see it online.

If your repository is public, everyone can read its files. Check that no password, key or private file is in it before you publish.

Check yourself

  • Your site opens at a github.io address from a different device.
  • A small change you push appears online after a short wait.
  • You checked that the repository contains nothing private.