This guide will help you deploy the ApplyQuest frontend to your server using GitHub Actions.
-
Server Requirements:
- Ubuntu/Debian server with sudo access
- Nginx installed and configured
- Domain:
applyquest.vps.anishsheela.com - SSH access with key-based authentication
-
GitHub Secrets Required:
SERVER_HOST:applyquest.vps.anishsheela.comSERVER_USER: Your SSH username (e.g.,applyquest)SSH_PRIVATE_KEY: Your private SSH key (generate withssh-keygen)SERVER_PATH: Deployment path (e.g.,/var/www/applyquest)
sudo apt update
sudo apt install nginx
sudo systemctl enable nginx
sudo systemctl start nginxsudo mkdir -p /var/www/applyquest
sudo chown -R $USER:$USER /var/www/applyquestCreate /etc/nginx/sites-available/applyquest:
server {
listen 80;
server_name applyquest.vps.anishsheela.com;
root /var/www/applyquest;
index index.html;
# Enable gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss;
# Handle React Router
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
}Enable the site:
sudo ln -s /etc/nginx/sites-available/applyquest /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxsudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d applyquest.vps.anishsheela.comssh-keygen -t rsa -b 4096 -C "github-actions@applyquest"# Copy public key to server
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
# Or manually add to ~/.ssh/authorized_keys
cat ~/.ssh/id_rsa.pubGo to: Settings → Secrets and variables → Actions
Add these secrets:
SERVER_HOST:applyquest.vps.anishsheela.comSERVER_USER:applyquest(your SSH username)SSH_PRIVATE_KEY: Contents of~/.ssh/id_rsa(private key)SERVER_PATH:/var/www/applyquest
The GitHub Actions workflow (.github/workflows/deploy.yml) will:
- Checkout code from the
mainbranch - Setup Node.js and install dependencies
- Run tests (optional)
- Build the React app (
npm run build) - Deploy via SCP to your server
- Set proper permissions and reload nginx
If you prefer manual deployment:
# Run the deployment script
chmod +x deploy.sh
./deploy.shsudo systemctl status nginx
sudo nginx -t# Nginx logs
sudo tail -f /var/log/nginx/error.log
sudo tail -f /var/log/nginx/access.log
# Application logs (if any)
tail -f /var/log/applyquest.log# Test if files are deployed
curl -I https://applyquest.vps.anishsheela.com
# Check file permissions
ls -la /var/www/applyquest/-
403 Forbidden: Check file permissions
sudo chown -R www-data:www-data /var/www/applyquest
-
404 on refresh: React Router needs proper nginx config
location / { try_files $uri $uri/ /index.html; }
-
SSL Issues: Ensure certificate is valid
sudo certbot certificates
After deployment, monitor your application:
- Uptime: Use services like UptimeRobot
- Performance: Google PageSpeed Insights
- Errors: Check browser console and server logs
- Traffic: Nginx access logs or analytics
The workflow automatically deploys on every push to main. For manual deployment:
- Go to GitHub Actions tab
- Click "Deploy Frontend to Server"
- Click "Run workflow"
- SSL certificate installed
- Domain DNS configured
- Nginx configured and tested
- SSH keys set up
- GitHub secrets configured
- Test deployment works
- Monitor logs and performance
If you encounter issues:
- Check the GitHub Actions logs
- Review server logs
- Test locally first:
cd frontend && npm run build - Verify SSH connection:
ssh [email protected]
Happy deploying! 🚀