-
Notifications
You must be signed in to change notification settings - Fork 4
27 lines (24 loc) · 963 Bytes
/
deploy.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
name: Deploy
on:
push:
branches: [ main ]
defaults:
run:
working-directory: 'kontan-server'
jobs:
build-and-install:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Install dependencies, build and copy output dir
run: |
npm install
npm run build
cp -r dist ~/kontan/kontan-server
- name: Restart and run
run: |
echo "export PATH="$(npm config get prefix)"/bin/node:$PATH" > ~/kontan/kontan-server/startProd.sh
{ echo "cd /home/kontan/kontan/kontan-server"; echo "npm run serve:prod"; } >> ~/kontan/kontan-server/startProd.sh
echo "sudo killall ngrok" > ~/kontan/kontan-server/startProd.tunnel.sh
echo "ngrok http --config=$HOME/.config/ngrok/ngrok.yml --subdomain=kontan localhost:3000 --log=stdout > /var/log/ngrok.prod.log" >> ~/kontan/kontan-server/startProd.tunnel.sh
sudo supervisorctl restart kontan:*