fix: 추천 여러번 생성한 경우 읽음 버그 해결 (#24) #21
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: CI/CD to NCP Server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: deploy-main | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to NCP Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: satto-registry.kr.ncr.ntruss.com | |
| username: ${{ secrets.NCP_REGISTRY_USERNAME }} | |
| password: ${{ secrets.NCP_REGISTRY_PASSWORD }} | |
| - name: Build and Push Docker Image (linux/amd64) | |
| run: | | |
| docker buildx build --platform linux/amd64 \ | |
| -t satto-registry.kr.ncr.ntruss.com/satto-server-fastapi:latest \ | |
| --push . | |
| - name: Deploy to NCP Server | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.NCP_SERVER_HOST }} | |
| username: ${{ secrets.NCP_SERVER_USER }} | |
| password: ${{ secrets.NCP_SERVER_PASSWORD }} | |
| port: 22 | |
| script: | | |
| set -e | |
| cd /home/Satto-Server | |
| # 최신 이미지로 fastapi만 갱신/재기동 | |
| docker compose -f docker-compose.dev.yml up -d --pull always fastapi | |
| # 상태 확인 | |
| docker compose -f docker-compose.dev.yml ps fastapi | |
| # 사용되지 않는 이미지 정리 | |
| docker system prune |