File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deployment VPS
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+
7+ env :
8+ VPS_HOST : ${{ secrets.VPS_HOST }}
9+ VPS_SSH : ${{ secrets.VPS_SSH }}
10+ VPS_USER : ${{ secrets.VPS_USER }}
11+ VPS_PASSWORD : ${{ secrets.VPS_PASSWORD }}
12+
13+ jobs :
14+ deploy :
15+ name : Deploy to VPS
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+
22+ - name : Deploy to VPS via SSH
23+ uses : appleboy/ssh-action@v1.0.3
24+ with :
25+ host : ${{ env.VPS_HOST }}
26+ username : ${{ env.VPS_USER }}
27+ password : ${{ env.VPS_PASSWORD }}
28+ key : ${{ env.VPS_SSH }}
29+ script : |
30+ # Navigate to the executeme directory on the VPS.
31+ cd ~/workspace/executeme
32+
33+ # Pull the latest code from the 'main' branch of the GitHub repository.
34+ git pull
35+
36+ # Execute your bash script.
37+ bash ./script.sh
38+
39+ echo "Deployment complete!"
You can’t perform that action at this time.
0 commit comments