File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build, Test and Deploy Discord Bot to VPS but shorter
2+
3+ on :
4+ workflow_dispatch : # Allow manual deployment
5+
6+ jobs :
7+ deploy :
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v4
13+
14+ - name : Deploy to VPS
15+ 16+ with :
17+ host : ${{ secrets.VPS_HOST }}
18+ username : ${{ secrets.VPS_USER }}
19+ key : ${{ secrets.VPS_SSH_KEY }}
20+ script : |
21+ cd /home/${{ secrets.VPS_USER }}/webdev-bot
22+
23+ # Stash any local changes
24+ git stash push -m "Auto-deploy $(date)" 2>/dev/null || true
25+
26+ # Pull latest changes
27+ git checkout main
28+ git pull origin main
29+
30+ # Stop any existing containers
31+ docker-compose down || true
32+
33+ # Build and start production container with profile
34+ docker-compose --profile prod up -d --build
35+
36+ # Check status
37+ echo "Deployment completed. Container status:"
38+ docker-compose ps
You can’t perform that action at this time.
0 commit comments