Skip to content

Commit 15223d8

Browse files
authored
Create node.js.yml
1 parent a3e4b56 commit 15223d8

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/node.js.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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: Call-Api
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
runs-on: self-hosted
15+
16+
strategy:
17+
matrix:
18+
node-version: [20.x]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'pnpm' # Enable pnpm caching
28+
29+
- name: Install pnpm
30+
run: npm install -g pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install
34+
35+
- name: Build the project
36+
run: pnpm run build --if-present
37+
38+
- name: Setup .env
39+
run: |
40+
touch .env
41+
echo "${{ secrets.CALL_SECRETES }}" > .env
42+
43+
- name: Restart API with PM2
44+
run: pm2 restart BackendAPI

0 commit comments

Comments
 (0)