Skip to content

Merge pull request #121 from Team-def/change-controller-route-path #2

Merge pull request #121 from Team-def/change-controller-route-path

Merge pull request #121 from Team-def/change-controller-route-path #2

# dev.yml
name: auto-deploy-main
on: # 아래 job을 실행시킬 상황
push:
branches: [ main ]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest # 실행될 인스턴스 OS와 버전
steps:
- name: excuting remote ssh commands
uses: appleboy/[email protected] # ssh 접속하는 오픈소스
with:
host: ${{ secrets.REMOTE_IP }} # 인스턴스 IP
username: ${{ secrets.REMOTE_USER }} # 우분투 아이디
key: ${{ secrets.REMOTE_PRIVATE_KEY }} # ec2 instance pem key
port: ${{ secrets.REMOTE_SSH_PORT }} # 접속포트
script: | # 실행할 스크립트
cd /home/ubuntu/auto-deploy/recre-backend
git pull origin main
pm2 kill
npm i --force
npm run build
pm2 start dist/main.js