Auto Update Stats Dashboard #28
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: Auto Update Stats Dashboard | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| run-stats-script: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.14.6' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests matplotlib | |
| - name: Run Stats Script | |
| run: python stats/Stats_github_web.py | |
| - name: Commit and Push changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add stats/stats_database.json stats/stats_history.txt stats/*.png 2>/dev/null || true | |
| # Если изменения есть, комитим, подтягиваем твои новые коммиты сверху и пушим | |
| if ! git diff-index --quiet HEAD; then | |
| git commit -m "Auto-update stats" | |
| git pull --rebase origin main | |
| git push | |
| fi |