Update extraction_router.py #18
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: AI Model Docker Hub Push | |
| on: | |
| push: | |
| branches: ["release"] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| # jjy12163/ai-model:latest 태그로 Push | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/ai-model:latest | |
| # 🚀 옵션: AI 서버가 업데이트되었을 때 EC2에 접속해서 ai-server 컨테이너만 재시작 | |
| - name: Update EC2 AI Container | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USER }} | |
| key: ${{ secrets.EC2_KEY }} | |
| script: | | |
| cd /home/ubuntu/deploy | |
| sudo docker compose pull ai-server | |
| sudo docker compose up -d ai-server | |
| sudo docker image prune -f |