Skip to content

Commit 0fc4f36

Browse files
authored
Create node.js.yml
1 parent 89f12a1 commit 0fc4f36

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/node.js.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 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
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI/CD
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
build:
12+
runs-on: self-hosted
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
- run: npm ci
25+
- run: |
26+
touch .env
27+
echo "${{ secrets.MONGODB_URL }}" > .env
28+
- run: pm2 restart BackendAPI

0 commit comments

Comments
 (0)