Skip to content

Commit 070f7ca

Browse files
authored
Merge pull request #69 from asn6878/feat/rss-notifier-deploy
✨ feat: rss notifier 배포 추가
2 parents 365bb06 + 728fa2a commit 070f7ca

File tree

8 files changed

+1327
-55
lines changed

8 files changed

+1327
-55
lines changed

.github/workflows/deploy.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
script: |
2323
export NVM_DIR=~/.nvm
2424
source ~/.nvm/nvm.sh
25+
2526
cd /root/web05-Denamu
2627
git pull origin main
2728
cd server/
@@ -37,4 +38,22 @@ jobs:
3738
3839
npm ci
3940
npm run build
40-
nohup npm run start > server.log 2>&1 &
41+
42+
cd ..
43+
cd rss-notifier/
44+
45+
echo "PORT"=${{ secrets.RSS_NOTIFIER_PORT }} > .env
46+
echo "DB_HOST=${{ secrets.RSS_NOTIFIER_DB_HOST }} >> .env
47+
echo "DB_NAME=${{ secrets.RSS_NOTIFIER_DB_DATABASE }} >> .env
48+
echo "DB_USER=${{ secrets.RSS_NOTIFIER_DB_USER }} >> .env
49+
echo "DB_PASS=${{ secrets.RSS_NOTIFIER_DB_PASSWORD }} >> .env
50+
echo "DB_TABLE=${{ secrets.RSS_NOTIFIER_DB_TABLE }} >> .env
51+
echo "TIME_INTERVAL=${{ vars.RSS_NOTIFIER_TIME_INTERVAL }} >> .env
52+
53+
npm ci
54+
tsc
55+
56+
cd ..
57+
58+
pm2 delete all
59+
pm2 start ecosystem.config.js

ecosystem.config.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
apps: [
5+
{
6+
name: "Denamu",
7+
script: "./server/dist/main.js",
8+
instances: "1",
9+
exec_mode: "cluster",
10+
watch: false,
11+
autorestart: true,
12+
env: {
13+
NODE_ENV: "production",
14+
ENV_PATH: "server/configs/.env.db.production",
15+
},
16+
},
17+
{
18+
name: "rss-notifier",
19+
script: "./rss-notifier/dist/main.js",
20+
instances: "1",
21+
exec_mode: "fork",
22+
cron_restart: `*/30 * * * *`, // 30분 마다 rss-notifier 재시작
23+
autorestart: false,
24+
watch: false,
25+
},
26+
],
27+
};

0 commit comments

Comments
 (0)