-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (73 loc) · 2.05 KB
/
cd_dev.yaml
File metadata and controls
73 lines (73 loc) · 2.05 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: RERUM Server v1 Development Deploy on PR to main.
on:
pull_request:
branches: main
jobs:
merge-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Merge with main
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: ${{ github.head_ref }}
github_token: ${{ secrets.BRY_PAT }}
message: Merge main into this branch to deploy to dev for testing.
test:
needs: merge-branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Create .env from secrets
run: echo "${{ secrets.DEV_FULL_ENV }}" > .env
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: "24"
- name: Cache node modules
uses: actions/cache@master
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies and run the test
run: |
npm install
npm run runtest
deploy:
if: github.event.pull_request.draft == false
needs:
- merge-branch
- test
strategy:
matrix:
node-version:
- 24
machines:
- vlcdhp02
runs-on: ${{ matrix.machines }}
steps:
- uses: actions/checkout@master
- name: Deploy the app on the server
run: |
if [[ ! -e /srv/node/logs/rerumv1.txt ]]; then
mkdir -p /srv/node/logs
touch /srv/node/logs/rerumv1.txt
fi
cd /srv/node/v1-node/
pm2 stop rerum_v1
git stash
git pull
git checkout ${{ github.head_ref }}
git stash
git pull
npm install
pm2 start -i max bin/rerum_v1.js