Generate Stats Images #1373
This file contains 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: Generate Stats Images | |
on: | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: "5 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
cache: pip | |
- name: Install dependencies | |
run: pip3 install -q -r requirements.txt | |
- name: Generate statistics | |
run: python3 generate_images.py | |
env: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
EXCLUDED: ${{ secrets.EXCLUDED }} | |
EXCLUDED_LANGS: ${{ secrets.EXCLUDED_LANGS }} | |
EXCLUDE_FORKED_REPOS: false | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: svgs | |
path: generated | |
commit: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: svgs | |
path: generated | |
- run: | | |
git config user.name "github-actions" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add generated | |
git commit -m 'Update generated files' || echo | |
git push --force origin HEAD:gh-pages |