Skip to content

Merge pull request #69 from asn6878/feat/rss-notifier-deploy #10

Merge pull request #69 from asn6878/feat/rss-notifier-deploy

Merge pull request #69 from asn6878/feat/rss-notifier-deploy #10

Workflow file for this run

name: Deployment
on:
push:
branches:
- main
paths:
- "server/**"
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 "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
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