File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to VPS
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ deploy :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ # Step 1: Check out the repository
14
+ - name : Checkout code
15
+ uses : actions/checkout@v3
16
+
17
+ # Step 2: Deploy to the VPS using SSH
18
+ - name : Deploy to VPS
19
+
20
+ with :
21
+ host : 91.107.255.176
22
+ username : root
23
+ key : ${{ secrets.SSH_PRIVATE_KEY }}
24
+ port : 22
25
+ script : |
26
+ # Navigate to the project directory or clone if missing
27
+ if [ ! -d "/var/www/kanz-ai-web" ]; then
28
+ git clone https://github.com/Rezasz/Kanz-ai-web-2.git /var/www/kanz-ai-web
29
+ fi
30
+
31
+ cd /var/www/kanz-ai-web
32
+
33
+ # Pull the latest changes
34
+ git pull origin main
35
+
36
+ # Install dependencies and build
37
+ npm install
38
+ npm run build
39
+
40
+ # Copy built files to the web directory
41
+ cp -r dist/* /var/www/your-website/
42
+
43
+ # Restart Nginx to apply changes
44
+ systemctl restart nginx
You can’t perform that action at this time.
0 commit comments