[fix] root endpoint 설정 #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: moplus-server | |
| on: | |
| push: | |
| branches: main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy fastapi MainServer(main) | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ${{ secrets.SERVER_USERNAME }} | |
| key: ${{ secrets.SERVER_KEY }} | |
| script: | | |
| cd ~/moplus_server2 | |
| kill -9 $(lsof -t -i :8000) | |
| git add ../ | |
| git commit -m "temp commit" | |
| git fetch origin main | |
| git merge origin/main | |
| if [ $? -ne 0 ]; then # 병합 명령어의 종료 상태를 확인합니다. | |
| echo "Merge conflict detected. Resolving by applying remote changes." | |
| git checkout --theirs $(git diff --name-only --diff-filter=U) # 충돌이 발생한 파일에 원격 변경 사항을 적용합니다. | |
| git add . # 충돌이 해결된 파일을 스테이징합니다. | |
| git commit -m "Resolved merge conflicts by applying remote changes." # 커밋 메시지를 작성하여 충돌 해결을 커밋합니다. | |
| else | |
| echo "Merge successful, no conflicts detected." | |
| fi | |
| docker rm -f fastapi_app --force | |
| docker rmi moplus_server2_app | |
| docker-compose up --build -d | |