diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9d74d2e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: Node.js CI/CD + +on: + push: + branches: [ "master" ] + +jobs: + build: + runs-on: self-hosted + strategy: + matrix: + node-version: [22.x] + steps: + - uses: actions/checkout@v4.2.2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4.1.0 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test diff --git a/app.js b/app.js index be47006..b14cc3e 100644 --- a/app.js +++ b/app.js @@ -11,7 +11,7 @@ const server = http.createServer((req, res) => { }); server.listen(port, hostname, () => { - console.log(`Node JS Server is running at http://${hostname}:${port}/`); + console.log(` Node JS Server is running at http://${hostname}:${port}/`); }); module.exports = server;