-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.83 KB
/
develop.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
47
48
49
50
51
52
53
54
55
56
name: NestJS CI/CD
on:
push:
branches: [ "develop" ]
jobs:
build:
runs-on: self-hosted
environment: develop
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm install
- name: Build
run: npm run build
- name: 'Create env file'
run: |
touch .env
echo NODE_ENV=${{ vars.NODE_ENV }} >> .env
echo PORT=${{ vars.PORT }} >> .env
echo MONGODB_CONNECTION_STRING=${{ secrets.MONGODB_CONNECTION_STRING }} >> .env
echo CORS_VALID_ORIGINS=${{ vars.CORS_VALID_ORIGINS }} >> .env
echo JWT_ACCESS_SECRET=${{ vars.JWT_ACCESS_SECRET }} >> .env
echo JWT_ACCESS_EXPIRATION=${{ vars.JWT_ACCESS_EXPIRATION }} >> .env
echo JWT_REFRESH_SECRET=${{ vars.JWT_REFRESH_SECRET }} >> .env
echo JWT_REFRESH_EXPIRATION=${{ vars.JWT_REFRESH_EXPIRATION }} >> .env
echo SMTP_USERNAME=${{ secrets.SMTP_USERNAME }} >> .env
echo SMTP_PASSWORD=${{ secrets.SMTP_PASSWORD }} >> .env
echo SMTP_HOST=${{ vars.SMTP_HOST }} >> .env
echo SMTP_PORT=${{ vars.SMTP_PORT }} >> .env
echo SMTP_FROM_EMAIL=${{ vars.SMTP_FROM_EMAIL }} >> .env
echo SMTP_FROM_NAME=${{ vars.SMTP_FROM_NAME }} >> .env
- name: Deploy
run: pm2 restart efurniture-api
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}