Skip to content

Commit

Permalink
chore: Update build and start commands in node.js.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ROZ-MOFUMOFU-ME committed Nov 13, 2024
1 parent 70a62d1 commit 1593afa
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,29 @@ name: Node.js CI

on:
push:
branches: [ "main", "dev" ]
branches: ["main", "dev"]
pull_request:
branches: [ "main", "dev" ]
branches: ["main", "dev"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: npm install

- name: Install Dependencies
run: npm install
- name: Start
run: npm start

- name: Verify and Start
run: |
npm start > start.log 2>&1 &
START_PID=$!
sleep 5
if grep -q "config.json file does not exist. Read the installation/setup instructions." start.log; then
echo "Build and start completed successfully!"
kill $START_PID
exit 0
else
echo "An unexpected error occurred!"
fi
kill $START_PID
exit 1
- name: Verify
run: echo "Build completed successfully!"

0 comments on commit 1593afa

Please sign in to comment.