Skip to content

Add production deploy workflow and PM2 config #6

Add production deploy workflow and PM2 config

Add production deploy workflow and PM2 config #6

Workflow file for this run

name: Node.js CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- development
permissions:
id-token: write
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Setup Node.js
uses: actions/setup-node@main
with:
node-version: "24"
- name: Cache node modules
uses: actions/cache@main
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies and run the test
run: npm install && npm test
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Deploy the app on the server
run: echo "Deploying to production..."
- name: Wait for service to be ready
run: sleep 5