-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.27 KB
/
generate-docs.yaml
File metadata and controls
49 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 'Omar Besbes'
git config user.email '86571415+omar-besbes@users.noreply.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 }}