Incremental Index Update #585
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: Incremental Index Update | |
| on: | |
| workflow_run: | |
| workflows: ["Daily UOS Notices"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| inputs: | |
| mode: | |
| description: 'Indexing mode (incremental or full)' | |
| required: false | |
| default: 'incremental' | |
| type: choice | |
| options: | |
| - incremental | |
| - full | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'workflow_run' && | |
| github.event.workflow_run.conclusion == 'success') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade "setuptools<75" wheel | |
| pip install -r requirements-indexer.txt -v | |
| - name: Run indexer (incremental update) | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| DB_HOST: ${{ secrets.DB_HOST }} | |
| DB_USER: ${{ secrets.DB_USER }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| DB_NAME: ${{ secrets.DB_NAME }} | |
| DB_PORT: ${{ secrets.DB_PORT }} | |
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | |
| PINECONE_INDEX: ${{ secrets.PINECONE_INDEX }} | |
| PINECONE_NAMESPACE: ${{ secrets.PINECONE_NAMESPACE }} | |
| # 증분 업데이트 설정 | |
| INDEX_MODE: ${{ github.event.inputs.mode || 'incremental' }} | |
| INCREMENTAL_DAYS: 14 | |
| PYTHONPATH: ${{ github.workspace }}/src | |
| run: | | |
| python -m uosai.indexer.index |