Deploy codive-ai-server to GCP #29
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: Deploy codive-ai-server to GCP | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Deploy to Server | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.GCP_HOST }} | |
| username: ${{ secrets.GCP_USERNAME }} | |
| key: ${{ secrets.GCP_SSH_KEY }} | |
| script: | | |
| cd codive-ai | |
| # 최신 코드 받기 | |
| git pull origin main | |
| echo "HF_TOKEN=${{secrets.HF_TOKEN}}" > .env | |
| # Docker 다시 빌드 및 실행 (기존 컨테이너 교체) | |
| docker compose up -d --build | |
| # 불필요한 이미지 정리 | |
| docker image prune -f |