-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.1 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
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
echo "WEATHER_API=${{secrets.WEATHER_API}}" >> .env.production
echo "NEXT_PUBLIC_SOCKET_URL=${{secrets.SOCKET_URL}}" >> .env.production
npm install
npm run build
cd ..
- name: Deploy client via rsync
run: |
rsync -avzr client/nextbuild deploy:/home/web/site232454/html/
- name: Install server modules
run: |
cd server
npm install
cd ..
- name: Deploy node_modules via rsync (only new files)
run: |
rsync -avzr --ignore-existing server/node_modules deploy:/home/web/site232454/html/
- name: Deploy server via rsync
run: |
rsync -avzr --delete server/src/* deploy:/home/web/site232454/html/src