How to self-host website on Github Pages?

How to self-host website on Github Pages?
  1. Create git repo:
export REPO=nostr-site-demo
        mkdir $REPO; cd $REPO;
  1. Create $REPO on github.

  2. Init local repo and push to Github:

git init
        git add
        git commit -m "first commit"
        git branch -M main
        git remote add origin$USER/$REPO.git
        git push -u origin main
  1. Setup Github Pages:
  • open repo page on github
  • open Settings -> Pages
  • under Branch choose 'main' and save
  1. Wait 1-2 minutes and reload the settings -> Pages page until you see "Your site is live at URL".
  • copy URL of your github pages website
  1. Go to admin panel and choose your site and open Settings.
  • edit Website Address, paste the URL of your Github Pages address
  • click Save
  1. Download the updated zip archive for self-hosting at

  2. Extract files from archive to your REPO dir, commit, push to Github:

unzip path/to/zip/
        git add .
        git commit -m "Add site files"
        git push origin main
  1. Wait 1 minute for Github to update your site.

You should be done now!

⚡️ Zap