-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (58 loc) · 1.7 KB
/
main.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI/CD
on:
push:
branches: [develop-build]
jobs:
build-and-deploy:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Compile client
run: |
cd client
npm install
npm run build
cd ..
- name: Deploy client via rsync
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -avzr
path: client/nextbuild
remote_path: /home/web/site232454/html/
remote_host: ${{ secrets.SERVER_IP }}
remote_user: ${{ secrets.SERVER_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install server modules
run: |
cd server
npm install
cd ..
#- name: move src to server
# run: |
# cd server
# mv src/* .
#rm -rf src
#cd ..
- name: Delploy node modulesd
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -avzr
path: server/node_modules
remote_path: /home/web/site232454/html/
remote_host: ${{ secrets.SERVER_IP }}
remote_user: ${{ secrets.SERVER_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy server via rsync
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -avzr --delete
path: server/src/*
remote_path: /home/web/site232454/html/src
remote_host: ${{ secrets.SERVER_IP }}
remote_user: ${{ secrets.SERVER_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}