File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed
Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to Hostinger
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Setup Node.js
17+ uses : actions/setup-node@v4
18+ with :
19+ node-version : ' 20'
20+
21+ - name : Install dependencies
22+ run : npm install
23+
24+ - name : Build with Vite
25+ run : npm run build
26+
27+ - name : Upload Artifacts
28+ uses : actions/upload-artifact@v4
29+ with :
30+ name : deploy-files
31+ path : |
32+ ./dist
33+ ./api # Assuming your API folder is in the root of your repo
34+
35+ deploy :
36+ needs : build
37+ runs-on : ubuntu-latest
38+
39+ steps :
40+ - name : Download Artifacts
41+ uses : actions/download-artifact@v4
42+ with :
43+ name : deploy-files
44+
45+ - name : Deploy to Hostinger via SFTP
46+ uses : burnett01/rsync-deployments@5.2
47+ with :
48+ committer_name : GitHub Actions
49+ committer_email : actions@github.com
50+ args : -avz --delete
51+ ssh_key : ${{ secrets.HOSTINGER_PRIVATE_KEY }}
52+ remote_host : ${{ secrets.HOSTINGER_HOST }}
53+ remote_user : ${{ secrets.HOSTINGER_USER }}
54+ remote_path : ${{ secrets.HOSTINGER_REMOTE_PATH }}
55+
56+ - name : Move API Folder
57+ uses : appleboy/ssh-action@v1
58+ with :
59+ host : ${{ secrets.HOSTINGER_HOST }}
60+ username : ${{ secrets.HOSTINGER_USER }}
61+ key : ${{ secrets.HOSTINGER_PRIVATE_KEY }}
62+ script : |
63+ mv ${{ secrets.HOSTINGER_REMOTE_PATH }}/API ${{ secrets.HOSTINGER_REMOTE_PATH }}/API # replace api_folder_name
You can’t perform that action at this time.
0 commit comments