Skip to content

Commit 950d8dd

Browse files
authored
Create node.js.yml
1 parent 89b8909 commit 950d8dd

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/node.js.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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: CI/CD for Server and Web
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
server:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18.x'
21+
- name: Install dependencies for server
22+
run: |
23+
cd server
24+
npm ci
25+
- name: Run server tests
26+
env:
27+
OPEN_API_KEY: ${{ secrets.OPEN_API_KEY }}
28+
run: |
29+
cd server
30+
npm test
31+
web:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Set up Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '18.x'
39+
- name: Install dependencies for web
40+
run: |
41+
cd web
42+
npm ci
43+
- name: Build web app
44+
run: |
45+
cd web
46+
npm run build
47+
# build:
48+
49+
# runs-on: ubuntu-latest
50+
51+
# strategy:
52+
# matrix:
53+
# node-version: [18.x, 20.x, 22.x]
54+
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
55+
56+
# steps:
57+
# - uses: actions/checkout@v4
58+
# - name: Use Node.js ${{ matrix.node-version }}
59+
# uses: actions/setup-node@v4
60+
# with:
61+
# node-version: ${{ matrix.node-version }}
62+
# cache: 'npm'
63+
# - run: npm ci
64+
# - run: npm run build --if-present
65+
# - run: npm test

0 commit comments

Comments
 (0)