|
| 1 | +# Deploying to GitHub Pages |
| 2 | + |
| 3 | +This document explains how to deploy the GitHub Copilot Usage Analyzer to GitHub Pages. |
| 4 | + |
| 5 | +## Automated Deployment |
| 6 | + |
| 7 | +This project includes a GitHub Actions workflow that automatically builds and deploys the application to GitHub Pages whenever changes are pushed to the `main` branch. |
| 8 | + |
| 9 | +### How It Works |
| 10 | + |
| 11 | +1. The workflow `.github/workflows/deploy-to-pages.yml` is triggered on pushes to the `main` branch or manually from the Actions tab. |
| 12 | +2. It builds the application and configures it for GitHub Pages deployment with the correct base path. |
| 13 | +3. The built application is deployed to GitHub Pages automatically. |
| 14 | + |
| 15 | +### Setting Up GitHub Pages |
| 16 | + |
| 17 | +To enable GitHub Pages deployment for this repository: |
| 18 | + |
| 19 | +1. Go to your repository on GitHub |
| 20 | +2. Click on "Settings" |
| 21 | +3. Navigate to "Pages" in the left sidebar |
| 22 | +4. Under "Build and deployment" > "Source", select "GitHub Actions" |
| 23 | +5. The workflow will now be able to deploy to GitHub Pages |
| 24 | + |
| 25 | +## Manual Deployment |
| 26 | + |
| 27 | +If you prefer to deploy manually or need to test locally first: |
| 28 | + |
| 29 | +1. Update the base path in `vite.config.ts`: |
| 30 | + |
| 31 | + ```typescript |
| 32 | + build: { |
| 33 | + outDir: process.env.OUTPUT_DIR || 'dist', |
| 34 | + base: "/spark-template/" // Add this line (replace with your repo name) |
| 35 | + } |
| 36 | + ``` |
| 37 | + |
| 38 | +2. Build the application: |
| 39 | + |
| 40 | + ```bash |
| 41 | + npm run build |
| 42 | + ``` |
| 43 | + |
| 44 | +3. Test the build locally: |
| 45 | + |
| 46 | + ```bash |
| 47 | + npm run preview |
| 48 | + ``` |
| 49 | + |
| 50 | +4. Deploy the contents of the `dist` directory to GitHub Pages using your preferred method. |
| 51 | + |
| 52 | +## Accessing Your Deployed Application |
| 53 | + |
| 54 | +Once deployed, your application will be available at: |
| 55 | +`https://[your-github-username].github.io/spark-template/` |
| 56 | + |
| 57 | +## Troubleshooting |
| 58 | + |
| 59 | +If you encounter any issues with the deployment: |
| 60 | + |
| 61 | +1. Check the GitHub Actions logs for any error messages |
| 62 | +2. Ensure GitHub Pages is properly configured in your repository settings |
| 63 | +3. Verify that the base path in the Vite configuration matches your repository name |
| 64 | +4. Check that the repository has proper permissions set for GitHub Pages deployment |
| 65 | + |
| 66 | +## Note About App Functionality |
| 67 | + |
| 68 | +When deployed to GitHub Pages, be aware that: |
| 69 | + |
| 70 | +1. The application is entirely client-side - all data processing happens in the browser |
| 71 | +2. No data is sent to any server when using the CSV upload feature |
| 72 | +3. If your CSV files are large, performance will depend on the user's device capabilities |
0 commit comments