First meeting 9/16! rm 307 @ Lunch
Sep 23rd, 2024

Deploying Static Sites on GitHub Pages

Author: Dhruva Srinivas

This is a rapid guide that goes through deploying static sites on GitHub Pages.

Prerequisites

  • A static web site with atleast an index.html file
  • A GitHub repository with said static web site

Step 1 - Add a publishing source

You can configure your GitHub Pages site to publish when changes are pushed to a specific branch, or you can write a GitHub Actions workflow to publish your site.

Literally so easy.

  1. Navigate to your repository on GitHub
  2. Under the repository, click on the “Settings” tab
  3. In the “Code and automation” section of the sidebar, click Pages.
  4. Under “Build and deployment”, under “Source”, select Deploy from a branch.
  5. Under “Build and deployment”, use the branch dropdown menu and select a publishing source.
  6. Save

Step 2 - Magic

  • GitHub looks for an index.html, index.md, or a README.md file in your repository as the entry-point for the website
  • IMPORTANT (but also obvious?) - The files mentioned above MUST be located at the top level of the source folder of the source branch!
    • For example, if you configured your publishing source in the / (root) folder on the main branch, your index.html file should be in / on the main branch.
  • Go to Settings -> Pages -> Visit Site (under GitHub pages)
  • Your static website is now live on the internet!

For detailed documentation: https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site

© 2024 Tinovation. Made with SvelteKit & Tailwind.