Skip to content

Commit c3cdc5f

Browse files
authored
Create main2.yml
1 parent e4ae6af commit c3cdc5f

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/main2.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Generate Stats Images
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
schedule:
7+
- cron: "5 0 * * *"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# Check out repository under $GITHUB_WORKSPACE, so the job can access it
19+
- uses: actions/checkout@v3
20+
21+
# Run using Python 3.8 for consistency and aiohttp
22+
- name: Set up Python 3.8
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.8'
26+
architecture: 'x64'
27+
cache: 'pip'
28+
29+
# Install dependencies with `pip`
30+
- name: Install requirements
31+
run: |
32+
python3 -m pip install --upgrade pip setuptools wheel
33+
python3 -m pip install -r requirements.txt
34+
35+
# Generate all statistics images
36+
- name: Generate images
37+
run: |
38+
python3 --version
39+
python3 generate_images.py
40+
env:
41+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
EXCLUDED: ${{ secrets.EXCLUDED }}
44+
EXCLUDED_LANGS: ${{ secrets.EXCLUDED_LANGS }}
45+
EXCLUDE_FORKED_REPOS: true
46+
47+
# Commit all changed files to the repository
48+
- name: Commit to the repo
49+
run: |
50+
git config --global user.name "jstrieb/github-stats"
51+
git config --global user.email "github-stats[bot]@jstrieb.github.io"
52+
git add .
53+
# Force the build to succeed, even if no files were changed
54+
git commit -m 'Update generated files' || true
55+
git push

0 commit comments

Comments
 (0)