News Commentary Bot (Gemini) #1571
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
| name: News Commentary Bot (Gemini) | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Каждый час | |
| workflow_dispatch: # Возможность запуска вручную | |
| jobs: | |
| comment-news: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| pip install google-generativeai requests beautifulsoup4 lxml | |
| - name: Run news commentary | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: python news_bot.py | |
| - name: Commit and push results | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add commentary/ | |
| git commit -m "Добавлен комментарий к новостям $(date)" || exit 0 | |
| git push |