I followed this guide to get gh-pages working with vite.

To replicate this:

  1. Name the main branch main
  2. copy the contents of github/ directory into in the new project
  3. in vite.config.js add the base direcory to be the repository name like so base: '/vite-pages-demo/'