Run Indexer #5799
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: Run Indexer | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| schedule: | |
| - cron: '55 * * * *' | |
| permissions: | |
| contents: write | |
| jobs: | |
| run_indexer: | |
| strategy: | |
| matrix: | |
| environment: [Development, Production] | |
| indexer_type: [imap] | |
| include: | |
| - indexer_type: psp | |
| environment: Development | |
| fail-fast: false | |
| max-parallel: 1 | |
| runs-on: ubuntu-latest | |
| environment: ${{matrix.environment}} | |
| env: | |
| IMAP_API_DOWNLOAD_URL: ${{vars.IMAP_API_DOWNLOAD_URL}} | |
| IMAP_DATA_ACCESS_URL: ${{vars.DATA_ACCESS_URL}} | |
| IMAP_API_KEY: ${{secrets.IMAP_API_KEY}} | |
| INDEX_FILE_DESCRIPTOR: ${{vars.INDEX_FILE_DESCRIPTOR}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| - name: Run Index | |
| run: | | |
| python main.py ${{matrix.indexer_type}} | |
| - name: Commit and Push | |
| run: | | |
| git pull | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add . | |
| git diff --cached --quiet || git commit -m "Automatically update ${{matrix.indexer_type}} index file" | |
| git push | |