Skip to content

Commit ca9aaf2

Browse files
authored
Merge pull request #42 from asn6878/chore/continuous-deploy
📦 chore: CD 파이프라인 작성
2 parents 3c1f805 + 2b36e25 commit ca9aaf2

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

.github/workflows/deploy.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "server/**"
9+
10+
jobs:
11+
deployment:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# public 서버로 ssh 접속
15+
- name: ssh connection
16+
uses: appleboy/[email protected]
17+
with:
18+
host: ${{ secrets.HOST }}
19+
username: ${{ secrets.USERNAME }}
20+
key: ${{ secrets.SSH_KEY }}
21+
port: ${{ secrets.PORT }}
22+
script: |
23+
cd /root/web05-Denamu
24+
git pull origin main
25+
cd server/
26+
npm install
27+
npm build
28+
pm2 start ecosystem.config.js
29+
30+
# TODO : 환경변수 추가

server/ecosystem.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: 'Denamu',
5+
script: './dist/main.js',
6+
instances: 'max',
7+
exec_mode: 'cluster',
8+
},
9+
],
10+
};

server/src/app.module.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { Module } from '@nestjs/common';
2-
import { AppController } from './app.controller';
3-
import { AppService } from './app.service';
42

53
@Module({
64
imports: [],
7-
controllers: [AppController],
8-
providers: [AppService],
5+
controllers: [],
6+
providers: [],
97
})
108
export class AppModule {}

0 commit comments

Comments
 (0)