new: CSES Geometry problems #15
This file contains 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 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\n" >> "$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 }} |