Generate Stats Images #1498
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: Generate Stats Images | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master] | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Configure GPG Key | |
| run: echo -n "$GPG_KEY" | gpg --import | |
| env: | |
| GPG_KEY: ${{ secrets.GPG_KEY }} | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| architecture: "x64" | |
| cache: 'pip' | |
| - name: Install requirements | |
| run: | | |
| python3 -m pip install --upgrade pip setuptools wheel | |
| python3 -m pip install -r requirements.txt | |
| - name: Generate images | |
| run: | | |
| python3 --version | |
| python3 generate.py | |
| env: | |
| ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
| EXCLUDED: ${{ vars.EXCLUDED_REPOS }} | |
| EXCLUDED_LANGS: ${{ vars.EXCLUDED_LANGS }} | |
| INCLUDE_FORKED_REPOS: true | |
| EXCLUDE_CONTRIB_REPOS: false | |
| EXCLUDE_ARCHIVE_REPOS: false | |
| EXCLUDE_PRIVATE_REPOS: false | |
| EXCLUDE_PUBLIC_REPOS: false | |
| STORE_REPO_VIEWS: true | |
| STORE_REPO_CLONES: true | |
| - name: Commit to the repo | |
| run: | | |
| git config --global user.name ${{ secrets.GH_USERNAME }} | |
| git config --global user.email ${{ secrets.GH_EMAIL }} | |
| git config --global user.signingkey ${{ secrets.GPG_SIGNING_KEY }} | |
| git config --global commit.gpgsign true | |
| git add . | |
| # "echo" returns true so the build succeeds, even if no changed files | |
| git commit -m 'Update daily stats' || echo | |
| git push |