name: Actualizar datos e investigacion on: schedule: # Todos los dias: incorpora noticias de fin de semana y conserva el score profundo diario. - cron: "20 22 * * *" workflow_dispatch: permissions: contents: write actions: write concurrency: group: market-data cancel-in-progress: true jobs: update: runs-on: ubuntu-latest steps: - name: Descargar repositorio uses: actions/checkout@v7 - name: Preparar Python uses: actions/setup-python@v7 with: python-version: "3.12" cache: pip - name: Instalar dependencias run: pip install -r requirements.txt - name: Ejecutar pruebas cuantitativas run: python scripts/run_tests.py - name: Ejecutar pipeline reproducible run: python scripts/run_research_pipeline.py env: SEC_USER_AGENT: ${{ vars.SEC_USER_AGENT }} FRED_API_KEY: ${{ secrets.FRED_API_KEY }} ALERTS_ENABLED: ${{ vars.ALERTS_ENABLED }} ALERT_EMAIL_FROM: ${{ secrets.ALERT_EMAIL_FROM }} ALERT_EMAIL_TO: ${{ secrets.ALERT_EMAIL_TO }} GMAIL_APP_PASSWORD: ${{ secrets.GMAIL_APP_PASSWORD }} - name: Guardar actualizacion run: | git config user.name "market-data-bot" git config user.email "market-data-bot@users.noreply.github.com" git add public/data/*.json git diff --cached --quiet || git commit -m "data: actualizar mercado" git push # Los commits realizados con GITHUB_TOKEN no disparan workflows por push. # workflow_dispatch sí está permitido, por eso se solicita el despliegue # explícitamente después de guardar los artefactos de investigación. - name: Volver a publicar GitHub Pages env: GH_TOKEN: ${{ github.token }} run: gh workflow run deploy-pages.yml --ref main