-
Notifications
You must be signed in to change notification settings - Fork 25
36 lines (34 loc) · 936 Bytes
/
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
name: self-serve deployer
on:
push:
branches: [deploy-prod]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
runs-on: self-hosted
steps:
- name: checkout repo+branch
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: provision database
run: |
mkdir -p "$(dirname ${{ secrets.DB_PATH }})"
touch ${{ secrets.DB_PATH }}
- name: install and build server
run: |
cd server
npm install
- name: restart server
env:
DB_PATH: ${{ secrets.DB_PATH }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
PASSWORD_SALT: ${{ secrets.PASSWORD_SALT }}
ENV: ${{ secrets.ENV }}
PORT: ${{ secrets.PORT }}
run: |
cd server
npm run start:prod