|
| 1 | +# Deployment Guide |
| 2 | + |
| 3 | +## GitHub Pages Deployment |
| 4 | + |
| 5 | +This project is configured for automatic deployment to GitHub Pages using GitHub Actions. |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +1. A GitHub repository for this project |
| 10 | +2. GitHub Pages enabled in repository settings |
| 11 | + |
| 12 | +### Setup Steps |
| 13 | + |
| 14 | +1. **Push your code to GitHub:** |
| 15 | + |
| 16 | + ```bash |
| 17 | + git init |
| 18 | + git add . |
| 19 | + git commit -m "Initial commit: Vite + React + TypeScript setup" |
| 20 | + git branch -M main |
| 21 | + git remote add origin https://github.com/yourusername/power-interview-hero.git |
| 22 | + git push -u origin main |
| 23 | + ``` |
| 24 | + |
| 25 | +2. **Enable GitHub Pages:** |
| 26 | + - Go to your repository on GitHub |
| 27 | + - Navigate to Settings → Pages |
| 28 | + - Under "Build and deployment", select "GitHub Actions" as the source |
| 29 | + |
| 30 | +3. **Update base URL in vite.config.ts:** |
| 31 | + - Change the `base` property to match your repository name: |
| 32 | + ```typescript |
| 33 | + base: '/your-repo-name/'; |
| 34 | + ``` |
| 35 | + |
| 36 | +4. **Automatic Deployment:** |
| 37 | + - The GitHub Actions workflow will automatically trigger on pushes to the `main` branch |
| 38 | + - Check the "Actions" tab in your GitHub repository to monitor deployment progress |
| 39 | + - Once complete, your site will be available at: `https://yourusername.github.io/your-repo-name/` |
| 40 | + |
| 41 | +### Manual Deployment |
| 42 | + |
| 43 | +If you prefer manual deployment: |
| 44 | + |
| 45 | +1. Build the project: |
| 46 | + |
| 47 | + ```bash |
| 48 | + npm run build |
| 49 | + ``` |
| 50 | + |
| 51 | +2. Deploy the `dist` folder to your hosting service |
| 52 | + |
| 53 | +### Environment Variables |
| 54 | + |
| 55 | +For production deployments, you can set environment variables: |
| 56 | + |
| 57 | +1. Create a `.env.production` file (not committed to git) |
| 58 | +2. Add your production environment variables: |
| 59 | + ``` |
| 60 | + VITE_API_BASE_URL=https://production-api.example.com |
| 61 | + VITE_ENABLE_ANALYTICS=true |
| 62 | + ``` |
| 63 | +
|
| 64 | +### Custom Domain (Optional) |
| 65 | +
|
| 66 | +To use a custom domain with GitHub Pages: |
| 67 | +
|
| 68 | +1. Add a `CNAME` file to the `public` folder with your domain name |
| 69 | +2. Configure your DNS provider to point to GitHub Pages |
| 70 | +3. Enable "Enforce HTTPS" in GitHub Pages settings |
| 71 | +
|
| 72 | +## Other Hosting Options |
| 73 | +
|
| 74 | +### Vercel |
| 75 | +
|
| 76 | +```bash |
| 77 | +npm install -g vercel |
| 78 | +vercel |
| 79 | +``` |
| 80 | + |
| 81 | +### Netlify |
| 82 | + |
| 83 | +```bash |
| 84 | +npm install -g netlify-cli |
| 85 | +netlify deploy --prod |
| 86 | +``` |
| 87 | + |
| 88 | +### Traditional Web Server |
| 89 | + |
| 90 | +Simply upload the contents of the `dist` folder to your web server's public directory. |
0 commit comments