Skip to content

ci: automate README generation for CSES solutions #2

ci: automate README generation for CSES solutions

ci: automate README generation for CSES solutions #2

name: Generate Docs
on:
push:
branches:
- main
jobs:
generate-readme:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [CSES]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install jinja2
- name: Run script to generate README
run: |
python scripts/${{ matrix.platform }}/generate.py
- name: Commit and push changes
run: |
git config user.name 'GitHub Actions'
git config user.email 'actions@github.com'
git add solutions/${{ matrix.platform }}
git commit -m "docs(CSES): auto-generate ${{ matrix.platform }} README"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}