ci(gitea): add Gitea Actions deployment workflow and Gitea CI/CD guide
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
This commit is contained in:
42
.gitea/workflows/deploy.yml
Normal file
42
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Deploy RIT Freshers Hub to VPS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Live VPS
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: SSH into VPS and Deploy
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USERNAME }}
|
||||
key: ${{ secrets.VPS_SSH_KEY }}
|
||||
port: 22
|
||||
script: |
|
||||
echo "🚀 Starting Automated CI/CD Deployment from Gitea..."
|
||||
cd /var/www/freshers-hub
|
||||
|
||||
echo "📥 Pulling latest code from Gitea..."
|
||||
git pull origin main
|
||||
|
||||
echo "⚡ Building Frontend PWA..."
|
||||
npm install --production=false
|
||||
npm run build
|
||||
|
||||
echo "🤖 Building Go Chatbot..."
|
||||
cd /var/www/freshers-hub/chatbot-service
|
||||
go build -o chatbot-service main.go
|
||||
|
||||
echo "🔄 Restarting Systemd Services..."
|
||||
systemctl restart springboot chatbot telegram-bot nginx
|
||||
|
||||
echo "🎉 Deployment Completed Successfully!"
|
||||
Reference in New Issue
Block a user