-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1.13 KB
/
deploy.yaml
File metadata and controls
45 lines (35 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deployment VPS
on:
push:
branches: ["main"]
env:
VPS_HOST: ${{ secrets.VPS_HOST }}
VPS_SSH: ${{ secrets.VPS_SSH }}
VPS_USER: ${{ secrets.VPS_USER }}
VPS_PASSWORD: ${{ secrets.VPS_PASSWORD }}
jobs:
deploy:
name: Deploy to VPS
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy to VPS via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.VPS_HOST }}
username: ${{ env.VPS_USER }}
password: ${{ env.VPS_PASSWORD }}
key: ${{ env.VPS_SSH }}
script: |
# Navigate to the executeme directory on the VPS.
cd ~/workspace/executeme
# make sure we are in executeme directory
ls -a
# Pull the latest code from the 'main' branch of the GitHub repository.
git pull origin main
# Check git status to make sure everything is up to date
git status
# Execute your bash script.
bash ./scripts.sh
echo "Deployment complete!"