updating the workflow file to close the server that was started #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.x' | |
- run: cd backend && npm install | |
- run: cd backend && npm build | |
- run: cd backend && npm start | |
- run: cd backend && npm run test | |
- run: | | |
SERVER_PID=$(ps aux | grep 'node dist/server.js' | grep -v grep | awk '{print $2}') | |
kill $SERVER_PID |