-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.15 KB
/
code.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
39
40
41
42
43
44
45
46
name: Build and Deployment
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: |
echo "@iam-hussain:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.TOKEN }}" >> .npmrc
- run: npm ci
- run: npm run prisma:generate
- run: npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.TOKEN }}
deployment:
name: Deployment
needs: build
runs-on: ubuntu-latest
steps:
- name: Connect SSH and Run Scripts
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd /root/projects/qd-service
nvm use
git checkout .
git pull
npm ci
npm run prisma:setup
npm run build
pm2 restart qd-service