name: RAG Quality Gate on: push: branches: - main jobs: evaluate: name: Keyword Quality Check runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python 3.11 uses: actions/setup-python@v5 with: python-version: "3.11" - name: Cache pip dependencies uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements-prod.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies run: pip install -r requirements-prod.txt - name: Run keyword-only eval (CI gate) working-directory: . env: GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} CHROMA_API_KEY: ${{ secrets.CHROMA_API_KEY }} CHROMA_TENANT: ${{ secrets.CHROMA_TENANT }} CHROMA_DATABASE: ${{ secrets.CHROMA_DATABASE }} RAG_MODEL: llama-3.1-8b-instant JUDGE_MODEL: llama-3.1-8b-instant run: | python eval/evaluate.py \ --no-deepeval \ --threshold 0.5 deploy: name: Push to HuggingFace Space needs: evaluate runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true - name: Push to HuggingFace Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git config --global user.email "actions@github.com" git config --global user.name "github-actions" git remote add hf https://rishitpant:$HF_TOKEN@huggingface.co/spaces/rishitpant/AskTheHandbook git push hf main --force