This is the easiest method - just push to GitHub and let GitHub Actions handle everything automatically.
- Go to https://github.com/new
- Repository name:
cp-buying-system - Keep it public (required for free GitHub Pages)
- Don't initialize with README (we already have one)
- Click "Create repository"
# Add the remote repository (replace YOUR_USERNAME with your GitHub username)
git remote add origin https://github.com/YOUR_USERNAME/cp-buying-system.git
# Push to GitHub
git push -u origin main- Go to your repository on GitHub
- Click on "Settings" tab
- Click on "Pages" in the left sidebar
- Under "Build and deployment":
- Source: Select "GitHub Actions"
- Wait a few minutes for the deployment to complete
Your site will be live at:
https://YOUR_USERNAME.github.io/cp-buying-system/
The GitHub Actions workflow will automatically rebuild and deploy every time you push to the main branch!
If you prefer to deploy manually using the gh-pages package:
# Build and deploy in one command
npm run deployThis will:
- Build the production version
- Create/update the gh-pages branch
- Push to GitHub
Then enable GitHub Pages in your repository settings:
- Source: Deploy from a branch
- Branch: gh-pages
- Folder: / (root)
After deployment, check:
-
GitHub Actions Status:
- Go to the "Actions" tab in your repository
- You should see a successful deployment workflow
-
GitHub Pages Status:
- Settings → Pages
- You should see "Your site is live at https://..."
-
Test the Site:
- Visit the URL
- Navigate through all 4 screens:
- Command Center
- Forecasting Hub
- Policy Simulator
- Replenishment Workbench
Cause: The base path in vite.config.js doesn't match your repository name.
Solution: Update vite.config.js:
export default defineConfig({
plugins: [react()],
base: '/YOUR-REPO-NAME/', // Must match your repository name
})Cause: JavaScript/CSS files not loading correctly.
Solution:
- Check browser console for errors
- Verify the
basepath invite.config.js - Rebuild:
npm run build - Redeploy:
git pushornpm run deploy
Cause: Permissions not set correctly.
Solution:
- Go to Settings → Actions → General
- Scroll to "Workflow permissions"
- Select "Read and write permissions"
- Click "Save"
To use a custom domain:
- Add a
CNAMEfile to the/publicfolder with your domain - Configure DNS settings with your domain provider
- Enable "Enforce HTTPS" in GitHub Pages settings
See: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site
To update the deployed site:
# Make your changes
git add .
git commit -m "Description of changes"
git push origin mainGitHub Actions will automatically rebuild and deploy!
To test the production build locally before deploying:
# Build for production
npm run build
# Preview the production build
npm run previewVisit http://localhost:4173 to see the production version.