This guide explains how to deploy the iAgent application to GitHub Pages using GitHub Actions.
- GitHub Repository: Your repository must be public or you need GitHub Pro for private repository deployment
- GitHub Pages Enabled: Enable GitHub Pages in your repository settings
- GitHub Actions: Ensure GitHub Actions are enabled for your repository
- Go to your repository on GitHub
- Click on Settings tab
- Scroll down to Pages section
- Under Source, select Deploy from a branch
- Choose gh-pages branch and /(root) folder
- Click Save
The application automatically deploys to GitHub Pages when you push to the main branch. The deployment process:
- Trigger: Push to
mainbranch or manual workflow dispatch - Build: Frontend is built using Nx and Vite
- Deploy: Built files are deployed to the
gh-pagesbranch - Verify: Basic connectivity test is performed
The following files are automatically created during deployment:
.nojekyll- Bypasses Jekyll processingrobots.txt- Search engine directives- All built frontend assets
Your application will be available at:
https://{username}.github.io/iAgent/
Replace {username} with your GitHub username.
To manually trigger a deployment:
- Go to Actions tab in your repository
- Select 🚀 Deploy to GitHub Pages workflow
- Click Run workflow
- Choose branch and click Run workflow
The frontend is built with the following configuration:
- Base URL:
/iAgent/(for GitHub Pages) - Environment: Production
- Build Tool: Nx + Vite
- Output Directory:
dist/apps/frontend
- Check the GitHub Actions logs for errors
- Ensure all dependencies are properly installed
- Verify the Nx configuration is correct
- Check if GitHub Pages is enabled
- Verify the
gh-pagesbranch exists - Check repository permissions for GitHub Actions
- Ensure the base URL is correctly set to
/iAgent/ - Check if the
gh-pagesbranch contains the built files - Wait a few minutes for GitHub Pages to update
The following environment variables are set during build:
VITE_BASE_URL:/iAgent/VITE_API_BASE_URL:/iAgent/apiVITE_ENVIRONMENT:production
.github/workflows/deploy-gh-pages.yml: Main deployment workflow.github/workflows/ci.yml: Continuous Integration.github/workflows/cd.yml: Continuous Deployment (advanced)
If you encounter issues:
- Check the GitHub Actions logs
- Review this deployment guide
- Check the repository issues
- Create a new issue with detailed error information