index safe repos workflow #155
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: index safe repos workflow | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "30 4 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| run_index_safe_repos: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 180 | |
| env: | |
| GH_API_KEY: ${{ secrets.GITHUB_TOKEN }} | |
| CB_API_KEY: ${{ secrets.CODEBERG_TOKEN }} | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| API_KEY: ${{ secrets.API_KEY }} | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| steps: | |
| - name: repo | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b | |
| - name: uv sync and install important things | |
| run: | | |
| cd ./src/readme_keyword_extraction | |
| uv sync | |
| uv run uvicorn main:app --host 0.0.0.0 --port 8000 & | |
| - name: wait for 20 seconds before starting, for server to start | |
| run: | | |
| sleep 20 | |
| curl http://127.0.0.1:8000/extract_keywords | |
| - name: install hf | |
| run: curl -LsSf https://hf.co/cli/install.sh | bash | |
| - name: Download index-safe-repos binary | |
| run: wget -O index-safe-repos https://github.com/Zigistry/database/releases/download/executables/index-safe-repos | |
| - name: Download database | |
| run: wget -O ./zigistry.db https://huggingface.co/buckets/Zigistry/Zigistry/resolve/zigistry.db?download=true | |
| - name: Make binary executable | |
| run: chmod +x ./index-safe-repos | |
| - name: Run index-safe-repos | |
| run: ./index-safe-repos | |
| - name: Run dependents calculator | |
| run: sqlite3 ./zigistry.db < ./Database_SQL_Files/dependents_calculator.sql | |
| - name: push updated database | |
| run: hf cp ./zigistry.db hf://buckets/Zigistry/Zigistry/zigistry.db |