Worked on Backend codebase #56
This file contains hidden or 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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- backup # Adjust to your branch name | |
jobs: | |
build: | |
runs-on: self-hosted # Self-hosted Ubuntu runner | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 # Action to checkout your repository | |
- name: Stop PM2 | |
run: | | |
pm2 stop all || true # Stop all running PM2 processes | |
- name: Install Dependencies | |
run: | | |
cd server | |
npm install | |
- name: Start Application with PM2 | |
run: | | |
cd server | |
pm2 start index.js # Start your application using PM2, replace 'index.js' with your entry file if different |