KTU Bot Production Deploy #70
  
    
      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: KTU Bot Production Deploy | |
| on: | |
| workflow_run: | |
| workflows: ["KTU Bot Test Deploy"] | |
| types: | |
| - completed | |
| push: | |
| branches: | |
| - "prod" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.event.workflow_run.conclusion == 'success' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Pull and Deploy | |
| run: | | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/ktu-bot:${{ github.sha }} | |
| docker tag ${{ secrets.DOCKERHUB_USERNAME }}/ktu-bot:${{ github.sha }} ktu-bot:latest | |
| docker stop ktu-bot || true | |
| docker rm ktu-bot || true | |
| docker run -d --restart always \ | |
| -p 5000:5000 \ | |
| -e TZ=Asia/Kolkata \ | |
| -e ENV_TYPE=${{ secrets.ENV_TYPE }} \ | |
| -e ADMIN_ID=${{ secrets.ADMIN_ID }} \ | |
| -e BOT_TOKEN=${{ secrets.BOT_TOKEN }} \ | |
| -e FIREBASE_SERVICE_ACCOUNT="${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" \ | |
| -e HUGGING_FACE_TOKEN="${{ secrets.HUGGING_FACE_TOKEN }}" \ | |
| -e FIREBASE_STORAGE_BUCKET="${{ secrets.FIREBASE_STORAGE_BUCKET }}" \ | |
| --name ktu-bot ktu-bot:latest |