Codeberg Automatic Update #176
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: Codeberg Automatic Update | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "30 22 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| run_cron_codeberg: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 180 | |
| env: | |
| 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 cron-codeberg binary | |
| run: wget -O cron-codeberg https://github.com/Zigistry/database/releases/download/executables/cron-codeberg | |
| - name: Download the database | |
| run: wget -O ./zigistry.db https://huggingface.co/buckets/Zigistry/Zigistry/resolve/zigistry.db?download=true | |
| - name: Make binary executable | |
| run: chmod +x ./cron-codeberg | |
| - name: Run cron-codeberg | |
| run: ./cron-codeberg | |
| - name: push updated database | |
| run: hf cp ./zigistry.db hf://buckets/Zigistry/Zigistry/zigistry.db |