File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -3,34 +3,40 @@ name: Node.js CI/CD
3
3
on :
4
4
push :
5
5
branches :
6
- - main # or any branch you'd like to trigger on
6
+ - main # Trigger on push to main branch
7
7
pull_request :
8
8
branches :
9
- - main # or any branch you'd like to trigger on
9
+ - main # Trigger on PR to main branch
10
10
11
11
jobs :
12
12
build :
13
13
runs-on : ubuntu-latest
14
14
15
15
steps :
16
- # Check out the code from the repository
16
+ # Check out the code
17
17
- name : Checkout repository
18
18
uses : actions/checkout@v2
19
19
20
20
# Set up Node.js
21
21
- name : Set up Node.js
22
22
uses : actions/setup-node@v2
23
23
with :
24
- node-version : ' 16' # Specify the Node.js version you need
24
+ node-version : ' 16' # Specify Node.js version
25
25
26
26
# Install dependencies
27
27
- name : Install dependencies
28
28
run : |
29
29
cd src/npm
30
- npm install express multer axios cors
30
+ npm install
31
31
32
- # Run your Node .js application (server.js)
32
+ # Run server .js in the background
33
33
- name : Run server.js
34
34
run : |
35
35
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."
You can’t perform that action at this time.
0 commit comments