Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
2.3 KiB
2.3 KiB
🦊 RIT Freshers Hub - Gitea CI/CD Pipeline Guide
Automate your deployments from your self-hosted Gitea repository (https://git.rit-services.in/ShanmugaKrishnanSM/RIT-nexus.git) directly to your live VPS!
🛠️ Choose Your Preferred Gitea CI/CD Method:
- Method 1: Gitea Actions (Recommended if Gitea Actions is enabled) — Uses
.gitea/workflows/deploy.ymlwith identical syntax to GitHub Actions. - Method 2: Gitea Webhook + Lightweight VPS Script (Fastest & Zero Setup) — Gitea sends an HTTP trigger on push to automatically execute
git pull && npm run buildon your VPS.
🚀 Method 1: Setting Up Gitea Actions
Step 1: Add Secrets in Gitea
- Open your repository in Gitea:
https://git.rit-services.in/ShanmugaKrishnanSM/RIT-nexus - Click Settings (top right) ➔ Actions ➔ Secrets.
- Add these 3 secrets:
VPS_HOST:129.121.126.66VPS_USERNAME:rootVPS_SSH_KEY: Paste your SSH Private Key (cat ~/.ssh/id_rsafrom VPS).
Step 2: Push Workflow File
The Gitea workflow file is located at .gitea/workflows/deploy.yml.
Every git push origin main will automatically run the deployment steps on your VPS!
⚡ Method 2: Setting Up Gitea Webhook (Lightweight & Instant)
If Gitea Actions runner is not active on your Gitea instance, you can use a native Gitea Webhook:
Step 1: Create a Deploy Script on VPS
On your VPS terminal (ssh root@129.121.126.66), create a deployment shell script:
cat << 'EOF' > /var/www/freshers-hub/deploy.sh
#!/bin/bash
echo "🚀 Deploying latest code from Gitea..."
cd /var/www/freshers-hub
git pull origin main
npm run build
cd chatbot-service && go build -o chatbot-service main.go
systemctl restart springboot chatbot telegram-bot nginx
echo "✅ Deployment finished!"
EOF
chmod +x /var/www/freshers-hub/deploy.sh
Step 2: Add Webhook in Gitea
- Go to your Gitea Repo ➔ Settings ➔ Webhooks.
- Click Add Webhook ➔ Select Gitea.
- Target URL:
http://129.121.126.66:9000/hooks/deploy(or your webhook port). - HTTP Method:
POST - Trigger On: Push Events.
- Click Add Webhook.
Whenever you push code to Gitea, it triggers deploy.sh on your VPS instantly!