Skip to content

Commit

Permalink
fix: action pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
vishakh-abhayan committed Nov 15, 2024
1 parent 9678f93 commit cab7fe2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,25 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Create .env file
run: |
echo "GROQ_API_KEY=${{ secrets.secrets.GROQ_API_KEY }}" > .env
echo "PORT=${{ secrets.secrets.PORT }}" >> .env
- name: Sync code to application directory
run: |
rsync -avz --delete \
--exclude 'node_modules' \
--exclude '.git' \
--exclude '.gitignore' \
--exclude 'README.md' \
--exclude '.github' \
./ /home/muhammedr7025/server
- name: Install dependencies in app directory
working-directory: /home/muhammedr7025/server
run: npm ci

- name: Install PM2 globally if not present
run: |
if ! command -v pm2 &> /dev/null; then
npm install pm2 -g
fi
- name: Restart PM2 process
working-directory: /home/muhammedr7025/server
run: pm2 restart ecosystem.config.js --env production
28 changes: 28 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
apps: [
{
name: "omr_backend",
script: "./src/app.js",
instances: 2,
exec_mode: "cluster",
watch: false,
max_memory_restart: "450M",
node_args: "--max-old-space-size=450",
exp_backoff_restart_delay: 100,
max_restarts: 10,
env_production: {
NODE_ENV: "production",
},
env_file: ".env",
merge_logs: true,
cwd: "/home/muhammedr7025/server",
error_file: "/home/muhammedr7025/logs/err.log",
out_file: "/home/muhammedr7025/logs/out.log",
log_date_format: "YYYY-MM-DD HH:mm:ss Z",
source_map_support: true,
instance_var: "INSTANCE_ID",
autorestart: true,
ignore_watch: ["node_modules", "logs"],
},
],
};

0 comments on commit cab7fe2

Please sign in to comment.