Files
awesome-kubernetes/.github/workflows/agentic_cron.yml

86 lines
3.1 KiB
YAML

name: Nubenetes Automated Agentic Curation
on:
schedule:
- cron: '0 5 * * 0'
workflow_dispatch:
inputs:
start_date:
description: 'Fecha inicial para la búsqueda (YYYY-MM-DD)'
required: true
default: '2024-10-01'
extraction_strategy:
description: 'Estrategia de Extracción'
required: true
default: 'search'
type: choice
options:
- search
- scroll
historical_mode:
description: 'Activar Modo Histórico'
required: false
default: 'true'
type: boolean
historical_chunked:
description: 'Trocear ejecución (múltiples PRs)'
required: false
default: 'false'
type: boolean
historical_until_date:
description: 'Fecha límite superior (tramo)'
required: false
default: ''
permissions:
contents: write
pull-requests: write
actions: write
jobs:
agentic-curation-process:
runs-on: ubuntu-latest
# Solo ejecutar en develop
if: github.ref == 'refs/heads/develop'
steps:
- name: Sincronización del repositorio
uses: actions/checkout@v4
with:
ref: develop
- name: Provisión del Entorno Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Instalación de dependencias (LIGERO Y ROBUSTO)
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir pydantic PyGithub aiohttp beautifulsoup4 httpx fake-useragent pytz python-dotenv twikit>=2.1.2 playwright playwright-stealth
playwright install chromium --with-deps
- name: Ejecución de la Canalización Agéntica Integral
env:
TWITTER_USERNAME: ${{ secrets.TWITTER_USERNAME }}
TWITTER_EMAIL: ${{ secrets.TWITTER_EMAIL }}
TWITTER_PASSWORD: ${{ secrets.TWITTER_PASSWORD }}
TWITTER_COOKIES: ${{ secrets.TWITTER_COOKIES }}
GEMINI_API_KEY_1: ${{ secrets.GEMINI_API_KEY_1 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXTRACTION_STRATEGY: ${{ github.event.inputs.extraction_strategy || 'search' }}
HISTORICAL_MODE: ${{ github.event.inputs.historical_mode || 'false' }}
HISTORICAL_CHUNKED: ${{ github.event.inputs.historical_chunked || 'false' }}
HISTORICAL_UNTIL_DATE: ${{ github.event.inputs.historical_until_date || '' }}
CURATION_START_DATE: ${{ github.event.inputs.start_date || '' }}
HISTORICAL_CHUNK_DAYS: '180'
PYTHONPATH: .
run: |
python -u src/main.py 2>&1 | tee output.log
# Lógica de Re-disparo para Modo Histórico (SOLO SI SE SOLICITA TROCEADO)
if [ "${{ github.event.inputs.historical_chunked }}" == "true" ] && grep -q "NEXT_CHUNK_START:" output.log; then
NEXT_DATE=$(grep "NEXT_CHUNK_START:" output.log | awk '{print $2}')
echo "Disparando siguiente tramo histórico hasta: $NEXT_DATE"
gh workflow run agentic_cron.yml -f historical_mode=true -f historical_chunked=true -f historical_until_date=$NEXT_DATE
fi