Skip to content

Commit

Permalink
Merge pull request #2 from erik1110/feature/api
Browse files Browse the repository at this point in the history
Feature/api
  • Loading branch information
erik1110 committed Jan 2, 2024
2 parents 88387c6 + 9403310 commit 0ba2456
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
nest run start
npm 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

0 comments on commit 0ba2456

Please sign in to comment.