This document provides a quick reference for the GitHub Pages deployment configuration.
✅ Status: Production-ready
Key Features:
- Uses official GitHub Actions:
upload-pages-artifact@v3anddeploy-pages@v4 - Proper permissions:
pages: write,id-token: write - Concurrency control to prevent concurrent deployments
- Environment variables configurable via repository settings
- Two-job workflow: build → deploy
- Bun for fast installs and builds
Environment Variables:
VITE_BASE_PATH- Auto-detected or set manuallyVITE_DATASET_URL- Optional custom dataset locationVITE_DATASET_BASE_URL- Optional dataset base path
✅ Status: Auto-detection enabled
Key Features:
- Automatic base path detection from
GITHUB_REPOSITORY - Handles both user sites (username.github.io) and project sites
- Manual override via
VITE_BASE_PATHenvironment variable - Optimized build with code splitting
- Source maps enabled for debugging
Auto-detection Logic:
If VITE_BASE_PATH is set → use it
Else if in GitHub Actions:
- If repo is username.github.io → use /
- Otherwise → use /repo-name/
Else → use /
✅ Status: HashRouter implemented
Router Choice: HashRouter (not BrowserRouter)
Why HashRouter?
- ✅ No server configuration needed
- ✅ Works on GitHub Pages out of the box
- ✅ Refresh works on any page
- ✅ Direct links work (/#/matrix, /#/ext/redis)
- ✅ Query parameters preserved (/#/matrix?platform=alpine)
Trade-off:
- URLs have
#(e.g.,/#/matrixinstead of/matrix) - This is standard for GitHub Pages SPAs
✅ Status: Comprehensive documentation
Sections:
- Quick Start - Get running in 3 commands
- Configuration - All environment variables explained
- GitHub Pages Deployment - Step-by-step setup
- Dataset Publishing - 3 different approaches
- Troubleshooting - 7 common issues with solutions
- Project Structure - Complete file tree
- Performance Features - Optimization details
- Fork/clone repository
- Enable GitHub Pages (Settings → Pages → Source: GitHub Actions)
- (Optional) Set repository variables if needed
- Push to main branch
- Wait for Actions workflow to complete
- Visit your site at
https://username.github.io/repo-name/
- Make changes locally
- Test with
bun run dev - Build with
bun run build - Commit and push to main
- GitHub Actions deploys automatically
Option 1: Include in repository
# Add dataset to public folder
mkdir -p public/data
cp manifest.json public/data/
cp -r snapshots public/data/
# Set repository variable
VITE_DATASET_BASE_URL=/data/
# Commit and push
git add public/data
git commit -m "Add dataset"
git pushOption 2: External dataset
# Set repository variable to external URL
VITE_DATASET_URL=https://data.example.com/manifest.json
# Ensure CORS is configured on the external server
# Then commit any code changes and pushAfter deployment, verify:
- Site loads: Visit your GitHub Pages URL
- Routing works: Navigate to
/#/matrixand/#/ext/gd - Refresh works: Hard refresh (Ctrl+Shift+R) on any page
- Filters work: Apply filters, check URL parameters
- Data loads: Check browser console for errors
- Assets load: Check Network tab, all CSS/JS should load
- Build status: Check Actions tab for workflow status
- Deploy logs: Click on workflow run for detailed logs
- Console errors: Use browser DevTools to check for runtime errors
- Performance: Use Lighthouse to audit performance
If a deployment fails:
# Revert the commit
git revert HEAD
# Push to trigger new deployment
git push origin mainOr use GitHub's deployment history:
- Go to Settings → Pages
- Find previous successful deployment
- Click to redeploy
Solution: Should not happen with HashRouter. If it does, verify:
src/App.tsxusesHashRouter(notBrowserRouter)- Browser URL includes
#(e.g.,/#/matrix)
Solution: Check base path configuration:
# In browser console
console.log(import.meta.env.BASE_URL)
# Should match your deployment path
# User site: "/"
# Project site: "/repo-name/"Solution: Check CORS and dataset URL:
- Open browser DevTools → Network tab
- Look for manifest.json request
- Check response status (should be 200)
- If CORS error, configure server headers
- If 404, verify VITE_DATASET_URL is correct
- Documentation: See README.md for detailed guides
- Issues: GitHub Issues for bug reports
- Discussions: GitHub Discussions for questions
.github/workflows/deploy.yml # Deployment workflow
vite.config.ts # Build configuration
src/App.tsx # Router setup
README.md # User documentation
DEPLOYMENT_SUMMARY.md # This file
# Local development
bun run dev
# Build for production
bun run build
# Preview production build
bun run preview
# Check TypeScript
bunx tsc --noEmit
# Check bundle size
ls -lh dist/assets/
# Serve dist folder locally
bunx serve dist