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
33on :
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
1111jobs :
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."
You can’t perform that action at this time.
0 commit comments