Build README #977
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: Build README | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 */12 * * *" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Check out repository under $GITHUB_WORKSPACE, so the job can access it | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Node setup for yearProgress.js | |
- name: Node Progress | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
- name: Update yearProgress.txt | |
run: node yearProgress.js > yearProgress.txt | |
# Python setup for build_readme.py/generate_images.py | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip setuptools wheel | |
python3 -m pip install -r requirements.txt | |
# Generate all statistics images | |
- name: Generate images`` | |
run: | | |
python3 --version | |
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: true | |
- name: Update README | |
run: |- | |
python build_readme.py | |
cat README.md | |
env: | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} | |
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} | |
- name: AI Generated image | |
run: | | |
python3 ai_generate_images.py | |
env: | |
OPENWEATHERMAP_API_KEY: ${{ secrets.OPENWEATHERMAP_API_KEY }} | |
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
# Commit all changed files to the repository | |
- name: Commit and push if changed | |
run: |- | |
git diff | |
git config --global user.email "hi@kuldeep.tech" | |
git config --global user.name "README-bot" | |
git add -A | |
git commit -m "🤖 Updated content" || exit 0 | |
git push |