Run Forecasting Bot Every Hour #2653
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 Forecasting Bot Every Hour | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Runs every hour on the hour (UTC) | |
| workflow_dispatch: | |
| jobs: | |
| run-bot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: true # Required to push back | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install patchright | |
| patchright install chromium | |
| - name: Run the bot | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ASKNEWS_CLIENT_ID: ${{ secrets.ASKNEWS_CLIENT_ID }} | |
| ASKNEWS_SECRET: ${{ secrets.ASKNEWS_SECRET }} | |
| BRIGHT_DATA_API_KEY: ${{ secrets.BRIGHT_DATA_API_KEY }} | |
| METACULUS_TOKEN: ${{ secrets.METACULUS_TOKEN }} | |
| PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY }} | |
| SERPER_KEY: ${{ secrets.SERPER_KEY }} | |
| run: | | |
| python Bot/main.py | |
| - name: Commit and push forecast files | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add Q2_tournament_forecasts/*.txt | |
| git commit -m "Add forecast outputs [skip ci]" || echo "No changes to commit" | |
| git pull --rebase origin main | |
| git push |