Skip to content

Commit

Permalink
Update node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SomSingh23 committed Oct 16, 2023
1 parent b0d4f08 commit 669bfb9
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.14.2]
# 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
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: node index.js
node-version: 16.14.2
- name: Install dependencies
run: npm install

- name: Set up environment variables
run: |
echo "NODE_ENV=production" >> .env
echo "PORT=3000" >> .env
env:
DOTENV_PATH: .env

- name: Run tests
run: npm test

0 comments on commit 669bfb9

Please sign in to comment.