Skip to content

Merge pull request #215 from boostcampwm-2024/docs/swagger-update #61

Merge pull request #215 from boostcampwm-2024/docs/swagger-update

Merge pull request #215 from boostcampwm-2024/docs/swagger-update #61

Workflow file for this run

name: Deployment
on:
push:
branches:
- main
paths:
- "server/**"
workflow_dispatch: # 수동 실행을 허용하는 이벤트
jobs:
deployment:
runs-on: ubuntu-latest
steps:
# public 서버로 ssh 접속
- name: ssh connection
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
script: |
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd /root/web05-Denamu
git pull origin main
cd server/
mkdir -p configs
echo "PORT=${{ secrets.PRODUCT_PORT }}" > configs/.env.db.production
echo "DB_TYPE=mysql" >> configs/.env.db.production
echo "DB_DATABASE=${{ secrets.PRODUCT_DB_DATABASE }}" >> configs/.env.db.production
echo "DB_HOST=${{ secrets.PRODUCT_DB_HOST }}" >> configs/.env.db.production
echo "DB_PORT=${{ secrets.PRODUCT_DB_PORT }}" >> configs/.env.db.production
echo "DB_USERNAME=${{ secrets.PRODUCT_DB_USERNAME }}" >> configs/.env.db.production
echo "DB_PASSWORD=${{ secrets.PRODUCT_DB_PASSWORD }}" >> configs/.env.db.production
echo "REDIS_HOST=${{secrets.REDIS_HOST }}" >> configs/.env.db.production
echo "REDIS_PORT=${{secrets.REDIS_PORT}}" >> configs/.env.db.production
echo "REDIS_USERNAME=${{secrets.REDIS_USERNAME}}" >> configs/.env.db.production
echo "REDIS_PASSWORD=${{secrets.REDIS_PASSWORD}}" >> configs/.env.db.production
echo "EMAIL_USER=${{secrets.EMAIL_USER}}" >> configs/.env.db.production
echo "EMAIL_PASSWORD=${{secrets.EMAIL_PASSWORD}}" >> configs/.env.db.production
npm ci
npm run build
cd ..
cd rss-notifier/
echo "PORT=${{ secrets.RSS_NOTIFIER_PORT }}" > .env
echo "DB_HOST=${{ secrets.RSS_NOTIFIER_DB_HOST }}" >> .env
echo "DB_NAME=${{ secrets.RSS_NOTIFIER_DB_DATABASE }}" >> .env
echo "DB_USER=${{ secrets.RSS_NOTIFIER_DB_USER }}" >> .env
echo "DB_PASS=${{ secrets.RSS_NOTIFIER_DB_PASSWORD }}" >> .env
echo "DB_TABLE=${{ secrets.RSS_NOTIFIER_DB_TABLE }}" >> .env
echo "TIME_INTERVAL=${{ vars.RSS_NOTIFIER_TIME_INTERVAL }}" >> .env
npm ci
tsc
cd ..
pm2 delete all
pm2 start ecosystem.config.js