Skip to content

new: CSES Geometry problems #16

new: CSES Geometry problems

new: CSES Geometry problems #16

name: Generate Docs
on:
push:
branches:
- main
jobs:
generate-readme:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [CSES, France-IOI]
max-parallel: 1
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: Check for changes in the directory
id: check_changes
run: |
git diff --exit-code solutions/${{ matrix.platform }} || echo "changes=true" >> "$GITHUB_OUTPUT"
- name: Commit and push changes
if: steps.check_changes.outputs.changes == 'true'
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 }}