Lesson 15: Deploying with GitHub Pages
π Lesson 15: Deploying with GitHub Pages
GitHub Pages is a free hosting service that lets you deploy static websites directly from a GitHub repository. It's perfect for portfolios, documentation, or simple apps.
π¦ Step-by-Step: Deploy a Static Site
-
Push your code to the
mainbranch of your GitHub repository. - Go to your repository on GitHub, then navigate to Settings β Pages.
-
Under "Source", select
mainbranch and set the folder to/ (root). -
Click Save. GitHub will generate a deployment link like:
https://your-username.github.io/your-repo-name
β οΈ Important:
- Your entry point file must be named
index.htmlβ GitHub looks for this file to render your site. - It may take a few minutes for your site to go live after saving the settings.
π‘ Pro Tips
- Add a
CNAMEfile to connect a custom domain. - Use GitHub Actions for auto-deployment of build tools like React, Vue, or Svelte.
- Keep your site lightweight β Pages only supports static content (no backend).
Now you've got your first static site LIVE on the web β no server setup, no money down, just raw HTML glory!