name: Daily Leaderboard → GitHub Pages

on:
  schedule:
    - cron: '0 8 * * *'
  workflow_dispatch: {}

permissions:
  contents: write
  pages: write

jobs:
  publish-leaderboard:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install agentkit-cli
        run: pip install agentkit-cli

      - name: Configure git
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"

      - name: Run daily leaderboard and publish to Pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          agentkit daily --pages --pages-repo github:${{ github.repository }}
