rtip #266
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| schedule: | |
| - cron: '0 10 * * 1-5' # Lunes a viernes 10:00 UTC (7:00 Argentina) | |
| workflow_dispatch: # Permite ejecutar manualmente desde GitHub | |
| name: rtip | |
| permissions: | |
| contents: write | |
| jobs: | |
| run-r-script: | |
| runs-on: ubuntu-latest | |
| env: | |
| TELEGRAM_TOKEN_BOT: ${{ secrets.TELEGRAM_TOKEN_BOT }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Instalacion de paquetes | |
| run: "Rscript R/01-instalacion_paquetes.R" | |
| - name: Install curl | |
| run: | | |
| install.packages('curl') | |
| shell: Rscript {0} | |
| - name: Crea y postea tip | |
| run: "Rscript R/script_bot.R" | |
| - name: Commit results | |
| run: | | |
| git config --local user.email "actions@github.com" | |
| git config --local user.name "GitHub Actions" | |
| git add data/r_tips_historial.rds data/rtips-tuits.log data/r_tips_bot_usuarios.rds | |
| git diff --staged --quiet && echo "Sin cambios" || (git commit -m "posteo r tip" && git push origin) |