Tutorial 3: Practical Guide to Using GitHub Pages for Hosting Projects
1. Create Repository
git init my-website
cd my-website
touch index.html
git add .
git commit -m "Initial commit"
git push origin main
2. Enable GitHub Pages
- Go to repo's Settings→ Pages and select branch.
- Select branch:
main,folder:/ (root)or/docs - Github automatically builds and hosts your sites at:
https://username.github.io/my-website
3. Jekyll Structure
Jekyll turns Markdown files into static web pages
Structure:
/_layouts
/_posts
/_config.yml
/index.md
Example:
_config.yml:
title: My HPC Projects
theme: minima
4. Automate with GitHub Actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- usses: actions/jekyll-build-pages@v2