This project can be deployed to GitHub Pages using either automated GitHub Actions or manual deployment.
The project includes a GitHub Actions workflow that automatically deploys to GitHub Pages when you push to the main branch.
-
Enable GitHub Pages in your repository:
- Go to your repository on GitHub
- Navigate to Settings → Pages
- Under Source, select GitHub Actions
- Save the settings
-
Push to main branch:
- The workflow will automatically trigger on push to
main - You can also manually trigger it from the Actions tab → Deploy to GitHub Pages → Run workflow
- The workflow will automatically trigger on push to
-
Access your deployed site:
- After deployment, your site will be available at:
https://<your-username>.github.io/<repository-name>/ - Or if you have a custom domain configured, it will use that
- After deployment, your site will be available at:
To configure the custom domain admin.debtbox.sa:
-
CNAME file is already created in
public/CNAME(will be automatically included in builds) -
Add DNS CNAME record at your DNS provider:
- Type: CNAME
- Name:
admin - Value:
<your-org-or-username>.github.io(e.g.,debtbox.github.io) - TTL: 3600 (or default)
-
Configure in GitHub:
- Go to Settings → Pages → Custom domain
- Enter:
admin.debtbox.sa - Wait for DNS verification (can take a few minutes to hours)
If you prefer to deploy manually:
# Build the project
pnpm run build
# Deploy to GitHub Pages
pnpm run deployNote: Make sure you have the gh-pages package installed (already in devDependencies) and have push access to the repository.
- The build output directory is
dist/ - The base path in
vite.config.tsis set to/debtbox-admin/for GitHub Pages subdirectory deployment - When custom domain (admin.debtbox.sa) is configured and working, update the base path:
- In
vite.config.ts: Changebaseto'/'or setVITE_BASE_PATH='/'environment variable - The app will automatically use the correct base path via
VITE_BASE_PATHenvironment variable
- In
If your default branch is not main, update the workflow file:
- Edit
.github/workflows/deploy.yml - Change
branches: - mainto your branch name (e.g.,master)