-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (46 loc) · 1.07 KB
/
cd_prod.yaml
File metadata and controls
46 lines (46 loc) · 1.07 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
46
name: TinyNode production deploy on push to main.
on:
push:
branches: main
jobs:
test:
strategy:
matrix:
machines:
- vlcdhprdp02
runs-on: ${{ matrix.machines }}
steps:
- uses: actions/checkout@master
- name: Test the app on the server
run: |
cd /srv/node/tiny-node/
git stash
git checkout main
git pull
npm install
npm run allTests
deploy:
needs:
- test
strategy:
matrix:
node-version:
- 24
machines:
- vlcdhprdp02
runs-on: ${{ matrix.machines }}
steps:
- uses: actions/checkout@master
- name: Deploy the app on the server
run: |
if [[ ! -e /srv/node/logs/tinynode.txt ]]; then
mkdir -p /srv/node/logs
touch /srv/node/logs/tinynode.txt
fi
cd /srv/node/tiny-node/
pm2 stop tinyNode
git stash
git checkout main
git pull
npm install
pm2 start -i max bin/tinyNode.js