Skip to content

WillTiboReset Prediction #585

WillTiboReset Prediction

WillTiboReset Prediction #585

Workflow file for this run

name: WillTiboReset Prediction
on:
workflow_dispatch:
# Schedule trigger intentionally disabled. A server-side cron job calls the
# workflow_dispatch API every 30 minutes because GitHub's native schedule
# queue is unreliable for sub-hourly intervals and frequently delays/skips
# runs during high-load periods.
# schedule:
# - cron: '7,37 * * * *'
permissions:
contents: write
pages: write
id-token: write
# Prevent overlapping runs when a manual dispatch happens close to a scheduled run.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
predict:
runs-on: ubuntu-latest
steps:
- name: Print trigger info
run: |
echo "Triggered by: ${{ github.event_name }}"
echo "Run at: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Update model state
run: python update_model.py
- name: Run prediction
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
DEEPSEEK_MODEL: ${{ secrets.DEEPSEEK_MODEL }}
TIBO_RSS_URLS: ${{ secrets.TIBO_RSS_URLS }}
OPENAI_RSS_URLS: ${{ secrets.OPENAI_RSS_URLS }}
COMMUNITY_RSS_URLS: ${{ secrets.COMMUNITY_RSS_URLS }}
run: python predict.py
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
- name: Install frontend dependencies
run: npm ci
- name: Copy data for dashboard
run: npm run copy-data
- name: Build dashboard
run: npm run build
# Rebase before committing to survive race conditions when another
# commit (e.g. from a concurrent workflow run) lands on main first.
# git-auto-commit-action@v7 removed the `rebase` input, so we do it
# manually before the action.
- name: Pull latest to avoid push race
run: git pull --rebase --autostash origin main
- name: Commit prediction and model state
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "chore: auto-prediction and model-state update"
file_pattern: "output/prediction.json output/model_performance.json data/model_state.json data/prediction_history.json history.txt data/reset_history.json data/uncertain_events.json data/tweets.json"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
skip_fetch: true
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: dist
deploy:
needs: predict
runs-on: ubuntu-latest
timeout-minutes: 15
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5