Complete guide for deploying the TrainWithShubham Community Hub to GitHub Pages.
The site automatically deploys to GitHub Pages when you push to the main branch.
Live URL: https://community.trainwithshubham.com
- Push to main: Deploys immediately
- Hourly schedule: Rebuilds every hour to fetch fresh data from Google Sheets
- Manual: Can be triggered from GitHub Actions tab
- GitHub Actions runs
npm run build - Fetches data from Google Sheets (CSV endpoints)
- Fetches GitHub repository metadata
- Generates static HTML pages
- Deploys to GitHub Pages
Add a CNAME record to your DNS provider:
| Type | Name | Value | TTL |
|---|---|---|---|
| CNAME | community | trainwithshubham.github.io | 3600 |
- Go to Settings → Pages
- Enter custom domain:
community.trainwithshubham.com - Click Save
- Wait for DNS verification (5-15 minutes)
- Enable Enforce HTTPS
The workflow automatically creates a CNAME file during deployment:
- name: Create .nojekyll and CNAME files
run: |
touch out/.nojekyll
echo "community.trainwithshubham.com" > out/CNAME# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Preview production build
npx serve outLocal URL: http://localhost:3000
GITHUB_TOKEN: Automatically provided by GitHub Actions- Google Sheets CSV URLs are configured in
src/lib/env.ts
- Custom environment variables can be added to the workflow file
Check GitHub Actions logs:
- Go to Actions tab
- Click on the failed workflow
- Review build logs
Common issues:
- Google Sheets CSV endpoints unreachable
- GitHub API rate limiting (rare with token)
- TypeScript errors
If CSS doesn't load after deployment:
- Verify custom domain is configured correctly
- Check that CNAME file exists in deployment
- Clear browser cache
- Wait for DNS propagation (up to 48 hours)
- Wait 30 minutes after DNS verification
- Uncheck and re-check "Enforce HTTPS" in GitHub settings
- Verify DNS CNAME points to
trainwithshubham.github.io
- Before (Vercel): $20/month
- After (GitHub Pages): $0/month
- Annual Savings: $240/year
- Static Site Generation: All pages pre-rendered at build time
- Client-Side Search: Fuse.js for fuzzy search (no API calls)
- Build-Time Data: Fetches from Google Sheets during build
- GitHub API: Fetches repository metadata with retry logic
- Zero Server Cost: Pure static hosting
- Check Actions tab for deployment status
- Hourly rebuilds ensure data freshness
- Build logs show data fetch status
- Failed builds send notifications (if configured)