[4.1.0] Add global search filters (/filter command) (#144) #603
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 bot | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request_review: | |
| types: [submitted] | |
| workflow_dispatch: | |
| inputs: | |
| disable_tests: | |
| description: 'Disable E2E Tests' | |
| type: boolean | |
| required: false | |
| default: false | |
| jobs: | |
| build_and_test_staging: | |
| if: >- | |
| (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || | |
| github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch' | |
| runs-on: self-hosted | |
| env: | |
| ENABLE_TELEGRAM: ${{ secrets.ENABLE_TELEGRAM }} | |
| ENABLE_REST: ${{ secrets.ENABLE_REST }} | |
| ES_HOST: ${{ secrets.ES_HOST }} | |
| ES_USER: ${{ secrets.ES_USER }} | |
| ES_PASS: ${{ secrets.ES_PASS }} | |
| ES_TRANSCRIPTION_INDEX: ${{ secrets.ES_TRANSCRIPTION_INDEX }} | |
| TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
| DEFAULT_ADMIN: ${{ secrets.DEFAULT_ADMIN }} | |
| POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | |
| POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
| POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }} | |
| POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }} | |
| POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | |
| POSTGRES_SCHEMA: ${{ secrets.POSTGRES_SCHEMA }} | |
| BOT_USERNAME: ${{ secrets.BOT_USERNAME }} | |
| SPECIALIZED_TABLE: ${{ secrets.SPECIALIZED_TABLE }} | |
| DEFAULT_RESOLUTION_KEY: ${{ secrets.DEFAULT_RESOLUTION_KEY }} | |
| TEST_POSTGRES_DB: ${{ secrets.TEST_POSTGRES_DB }} | |
| TEST_POSTGRES_USER: ${{ secrets.TEST_POSTGRES_USER }} | |
| TEST_POSTGRES_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
| TEST_POSTGRES_HOST: ${{ secrets.TEST_POSTGRES_HOST }} | |
| TEST_POSTGRES_PORT: ${{ secrets.TEST_POSTGRES_PORT }} | |
| DISABLE_RATE_LIMITING: ${{ secrets.DISABLE_RATE_LIMITING }} | |
| REST_API_PORT: ${{ secrets.REST_API_PORT }} | |
| JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} | |
| TEST_ADMINS: ${{ secrets.TEST_ADMINS }} | |
| TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
| INLINE_CACHE_CHANNEL_ID: ${{ secrets.INLINE_CACHE_CHANNEL_ID }} | |
| REST_API_HOST: ${{ secrets.REST_API_HOST }} | |
| VIDEO_DATA_DIR: ${{ secrets.VIDEO_DATA_DIR }} | |
| VLLM_HOST: ${{ secrets.VLLM_HOST }} | |
| VLLM_EMBEDDINGS_MODEL: ${{ secrets.VLLM_EMBEDDINGS_MODEL }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Log in to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USR }} | |
| password: ${{ secrets.DOCKER_PAT }} | |
| - name: Build and push test image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| dam245222/ranchbot:test | |
| - name: Deploy test bot | |
| env: | |
| IMAGE_TAG: test | |
| RESTART_POLICY: no | |
| run: | | |
| docker compose pull --policy always | |
| if ! docker compose --project-name bot-test up -d --wait; then | |
| echo "Bot failed to start or become healthy" | |
| docker logs bot-test-bot-1 | |
| exit 1 | |
| fi | |
| echo "Bot is healthy and ready" | |
| - name: Set up Python | |
| if: ${{ inputs.disable_tests != true }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Run E2E Tests | |
| if: ${{ inputs.disable_tests != true }} | |
| env: | |
| PIP_ROOT_USER_ACTION: ignore | |
| run: | | |
| python3 -m pip install -r requirements.txt | |
| python3 -m pytest | |
| build_production: | |
| needs: build_and_test_staging | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: write | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Read version | |
| id: version | |
| run: echo "VERSION=$(cat VERSION)" >> "$GITHUB_OUTPUT" | |
| - name: Log in to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USR }} | |
| password: ${{ secrets.DOCKER_PAT }} | |
| - name: Build and push prod image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| dam245222/ranchbot:${{ steps.version.outputs.VERSION }} | |
| dam245222/ranchbot:latest | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| VERSION="v${{ steps.version.outputs.VERSION }}" | |
| if gh release view "$VERSION" &>/dev/null; then | |
| echo "Release $VERSION already exists, skipping" | |
| else | |
| gh release create "$VERSION" \ | |
| --title "Release $VERSION" \ | |
| --notes "Docker image: \`dam245222/ranchbot:${{ steps.version.outputs.VERSION }}\`" | |
| fi |