Skip to content

Commit 73ac73e

Browse files
authored
Update node.js.yml
1 parent 62873fa commit 73ac73e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/node.js.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,40 @@ name: Node.js CI/CD
33
on:
44
push:
55
branches:
6-
- main # or any branch you'd like to trigger on
6+
- main # Trigger on push to main branch
77
pull_request:
88
branches:
9-
- main # or any branch you'd like to trigger on
9+
- main # Trigger on PR to main branch
1010

1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
# Check out the code from the repository
16+
# Check out the code
1717
- name: Checkout repository
1818
uses: actions/checkout@v2
1919

2020
# Set up Node.js
2121
- name: Set up Node.js
2222
uses: actions/setup-node@v2
2323
with:
24-
node-version: '16' # Specify the Node.js version you need
24+
node-version: '16' # Specify Node.js version
2525

2626
# Install dependencies
2727
- name: Install dependencies
2828
run: |
2929
cd src/npm
30-
npm install express multer axios cors
30+
npm install
3131
32-
# Run your Node.js application (server.js)
32+
# Run server.js in the background
3333
- name: Run server.js
3434
run: |
3535
cd src/npm
36-
node server.js
36+
nohup node server.js & # Run in the background
37+
echo "Server is running on port 8080"
38+
39+
# Workflow completes here, without waiting for the server
40+
- name: Finish workflow
41+
run: |
42+
echo "The server is now running in the background."

0 commit comments

Comments
 (0)