Appearance
Deploy to GitHub Pages
GitHub Pages hosts static sites straight from a GitHub repository. Because the template uses base: './', it works at https://<user>.github.io/<repo>/ without any config changes.
Keep the template source private
Your licence doesn't allow publishing the template's source code, so don't put it in a public repo. GitHub Pages from a private repo needs a paid GitHub plan (Pro, Team or Enterprise). On a free account, use Option B below: only the built dist/ files go into a public repo, the source stays private.
Option A: private repo + GitHub Actions (paid GitHub plan)
Push your site to your own private repo (how).
In that repo, add this file:
yamlname: Deploy to GitHub Pages on: push: branches: [main] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - run: npm install - run: npm run build - uses: actions/upload-pages-artifact@v3 with: path: dist deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment uses: actions/deploy-pages@v4In the repo, open Settings → Pages and set Source to GitHub Actions.
Commit and push. Open the Actions tab to watch the build. When it's green, the site is at the URL shown in Settings → Pages.
Option B: publish only the built site (free account)
Here, the source stays in your private repo (or only on your computer), and a separate public repo holds nothing but the compiled dist/ files.
Create a new public repo, for example
my-site. For a site athttps://<user>.github.io/, name it<user>.github.io.Build and push only the contents of
dist/:bashnpm run build cd dist git init -b main git add -A git commit -m "Deploy" git remote add origin https://github.com/<user>/my-site.git git push -f origin main cd ..In the public repo: Settings → Pages → Source: Deploy from a branch →
main/ root → Save.After a minute, the site is live at
https://<user>.github.io/my-site/.
To update, rebuild and repeat step 2. (dist/ is recreated on each build, so git init is needed every time; the -f push replaces the previous version.)
Add .nojekyll
GitHub Pages runs Jekyll by default, which ignores files and folders starting with _. Vite doesn't normally create any, but to be safe add an empty file named .nojekyll to public/ in your project; it ends up in dist/ on every build.
Custom domain
Settings → Pages → Custom domain, enter www.yourdomain.com, then create the DNS records GitHub lists (a CNAME for www, A records for the apex domain). Tick Enforce HTTPS once the certificate is ready. For Option B, also add a CNAME file containing your domain to public/, so it survives every rebuild. See Custom domains & HTTPS.