update #91
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: update | |
| on: | |
| schedule: | |
| - cron: '0 */3 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.MY_PAT }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - run: pip install aiohttp | |
| - name: Запуск парсера | |
| working-directory: ./source | |
| run: | | |
| python parser.py | |
| # Копируем файлы в корневую папку deploy | |
| mkdir -p ../deploy/subscriptions | |
| cp -r deploy/* ../deploy/ 2>/dev/null || true | |
| - name: Коммит и пуш | |
| run: | | |
| git config --global user.name 'github-actions' | |
| git config --global user.email 'github-actions@github.com' | |
| git add -f deploy/ | |
| if git diff --staged --quiet; then | |
| echo "Нет изменений для коммита" | |
| else | |
| git commit -m "🔄 Автообновление $(date +'%Y-%m-%d %H:%M')" | |
| git pull --rebase origin main | |
| git push origin main | |
| fi | |