cluster-protocol / .github /workflows /weekly_retrain.yml
nice-bill's picture
cluster model routine training added
b96e9c6
name: Weekly Model Retraining
on:
schedule:
# Run at 00:00 every Monday
- cron: '0 0 * * 1'
workflow_dispatch: # Allow manual trigger for testing
jobs:
retrain:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to push changes back to the repo
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.4.15"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
cd cluster
uv sync
- name: Fetch new data from Dune
env:
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
run: |
cd cluster
uv run request.py
- name: Retrain Model
run: |
cd cluster
uv run train.py
- name: Update Visualizations
run: |
cd cluster
uv run visualize_clusters.py
- name: Commit and Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Weekly Model Retraining: Updated data and artifacts"
file_pattern: "cluster/data/* cluster/*.csv cluster/*.pkl cluster/docs/*.png"
branch: main