This document explains how to deploy the GitHub Copilot Premium Requests Usage Analyzer application to GitHub Pages.
This repository includes a GitHub Actions workflow that will automatically build and deploy the application to GitHub Pages whenever changes are pushed to the main branch.
-
Make sure your repository has GitHub Pages enabled:
- Go to your repository on GitHub
- Navigate to Settings > Pages
- For the Source, select "GitHub Actions"
-
Push your code to the
mainbranch:git add . git commit -m "Ready for deployment" git push origin main
-
The GitHub Actions workflow will automatically:
- Build the application using the GitHub Pages configuration
- Deploy the built files to the
gh-pagesbranch - Publish the site to GitHub Pages
-
Once deployed, your site will be available at
https://[your-username].github.io/[repo-name]/
You can also deploy manually using the npm scripts:
-
Install dependencies if you haven't already:
npm install
-
Build and deploy:
npm run deploy
This will:
- Build the application using the GitHub Pages specific configuration
- Deploy the built files to the
gh-pagesbranch
- The application uses a special Vite configuration for GitHub Pages deployment (
vite.github-pages.config.ts) - The
main-github-pages.tsxfile excludes Spark-specific imports that cause build issues - Build configuration excludes
@github/spark/sparkfrom bundling - Base URL is set to
'./'to allow relative paths on GitHub Pages
If you encounter deployment issues:
- Check the GitHub Actions workflow run for error messages
- Verify that GitHub Pages is properly configured in your repository settings
- Make sure all dependencies are properly installed
- Confirm that the GitHub Pages branch (gh-pages) is correctly set as the publishing source
- Examine the build logs for errors related to missing dependencies