Skip to content

Commit

Permalink
🌐 [Ci]: 배포 스크립트 파일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
g00hyun committed Dec 2, 2024
1 parent 09c9249 commit e093584
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/chat-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
push:
branches:
- develop
paths:
- 'apps/chat/**'
- Fix/336
# paths:
# - 'apps/chat/**'

jobs:
build-and-push:
Expand All @@ -18,6 +19,8 @@ jobs:
REDIS_PORT: ${{ secrets.REDIS_PORT }}
REDIS_CHAT: ${{ secrets.REDIS_CHAT }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
API_SERVER_URL: ${{ secrets.API_SERVER_URL }}
HTTP_TIMEOUT: ${{ secrets.HTTP_TIMEOUT }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -52,6 +55,8 @@ jobs:
REDIS_CHAT: ${{ secrets.REDIS_CHAT }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
NCLOUD_REGISTRY_URL: ${{ secrets.NCLOUD_REGISTRY_URL }}
API_SERVER_URL: ${{ secrets.API_SERVER_URL }}
HTTP_TIMEOUT: ${{ secrets.HTTP_TIMEOUT }}

steps:
- name: Checkout for docker-compose
Expand All @@ -73,7 +78,7 @@ jobs:
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_SERVER_KEY }}
port: 22
envs: CHAT_PORT,REDIS_HOST,REDIS_PORT,REDIS_CHAT,JWT_SECRET
envs: CHAT_PORT,REDIS_HOST,REDIS_PORT,REDIS_CHAT,JWT_SECRET,API_SERVER_URL,HTTP_TIMEOUT
script: |
cd /home/${{ secrets.SERVER_USER }}/camon
Expand All @@ -82,6 +87,8 @@ jobs:
echo "REDIS_PORT=$REDIS_PORT" >> .env
echo "REDIS_CHAT=$REDIS_CHAT" >> .env
echo "JWT_SECRET=$JWT_SECRET" >> .env
echo "API_SERVER_URL=$API_SERVER_URL" >> .env
echo "HTTP_TIMEOUT=$HTTP_TIMEOUT" >> .env
sudo docker login -u ${{secrets.NCLOUD_ACCESS_KEY}} -p ${{ secrets.NCLOUD_SECRET_KEY }} ${{ secrets.NCLOUD_REGISTRY_URL }}
Expand Down
5 changes: 4 additions & 1 deletion apps/chat/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ REDIS_PORT=
REDIS_CHAT=

# Jwt
JWT_SECRET=
JWT_SECRET=

API_SERVER_URL=
HTTP_TIMEOUT=
4 changes: 4 additions & 0 deletions apps/chat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ ARG REDIS_HOST
ARG REDIS_PORT
ARG REDIS_CHAT
ARG JWT_SECRET
ARG API_SERVER_URL
ARG HTTP_TIMEOUT

ENV CHAT_PORT=$CHAT_PORT
ENV REDIS_HOST=$REDIS_HOST
ENV REDIS_PORT=$REDIS_PORT
ENV REDIS_CHAT=$REDIS_CHAT
ENV JWT_SECRET=$JWT_SECRET
ENV API_SERVER_URL=$API_SERVER_URL
ENV HTTP_TIMEOUT=$HTTP_TIMEOUT

COPY --from=base /app/apps/chat/dist ./apps/chat/dist
COPY --from=base /app/node_modules ./node_modules
Expand Down

0 comments on commit e093584

Please sign in to comment.