-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (37 loc) · 1.16 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
name: CD
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# Runs on self hosted runner
runs-on: self-hosted
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Copy yapper-be
- name: Copy all files to yapper-server directory
run: |
cd yapper-be
cp -r . /home/debadri16/yapper-server/
# Install dependencies
- name: Install dependencies
run: |
cd /home/debadri16/yapper-server/
npm install
serve:
# Runs only after build is completed successfully
needs: build
# Runs on self hosted runner
runs-on: self-hosted
steps:
# start server and kill without error if it was running
- name: Start NodeJS server
run: |
cd /home/debadri16/yapper-server/
pkill -f server.js
nohup node server.js &