Merge branch 'master' of https://github.com/vignesh14052002/Knowledge… #25
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: Update README and VectorStore embeddings on push to main | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| # TODO: reddit links responds 403 status, can't able to use config file in link checker | |
| # markdown-link-check: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@master | |
| # - uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
| # with: | |
| # use-quiet-mode: 'yes' | |
| update-readme-and-embeddings: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Readme generation script | |
| run: python scripts/generate_readme.py | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| - name: Install dependencies with Poetry | |
| run: poetry install | |
| working-directory: chatbot/server | |
| - name: Run Update Embeddings script | |
| run: poetry run python scripts/update_embeddings.py | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| working-directory: chatbot/server | |
| - name: Check for changes | |
| id: git-diff | |
| run: echo "::set-output name=changes::$(git diff --exit-code > /dev/null && echo 'false' || echo 'true')" | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git commit -am "Update README and Embeddings via GitHub Action" | |
| git push | |
| if: steps.git-diff.outputs.changes == 'true' |