Skip to content

Commit 5795000

Browse files
Merge pull request #7 from devlopersabbir/sabbir
Sabbir
2 parents cb17de3 + 063dec9 commit 5795000

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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!"

0 commit comments

Comments
 (0)