-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.3 KB
/
main.yaml
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
name: Node.JS CI/CD
on:
push:
branches: [main]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3 # was "v2" before
with:
fetch-depth: 0
- name: Use Node.JS ${{ matrix.node-version }}
uses: actions/setup-node@v3 # was "v2" before
with:
node-version: ${{ matrix.node-version }}
- name: NPM install, build and test
run: |
npm install
npm run start
npm run test
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
ENCRYPT_JWT_SECRET: ${{ secrets.ENCRYPT_JWT_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_EXPIRATION: ${{ secrets.JWT_EXPIRATION }}
# Heavily modified deploy job to fit render.com
deploy:
name: Deploy
needs: [test] # Our tests must pass in order to run the deploy job
runs-on: ubuntu-latest
steps:
- name: Deploy to production
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.SERVICE_ID }} # Can be found as part of the Deploy Hook
api-key: ${{ secrets.RENDER_API_KEY }} # Create your API key in Render Dashboard > Account Settings