| 1 | name: docs |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | |
| 8 | jobs: |
| 9 | build: |
| 10 | runs-on: ubuntu-latest |
| 11 | strategy: |
| 12 | matrix: |
| 13 | python-version: [3.9] |
| 14 | steps: |
| 15 | - uses: actions/checkout@v2 |
| 16 | with: |
| 17 | fetch-depth: 0 |
| 18 | submodules: true |
| 19 | - name: Set up Python ${{ matrix.python-version }} |
| 20 | uses: actions/setup-python@v2 |
| 21 | with: |
| 22 | python-version: ${{ matrix.python-version }} |
| 23 | - name: Install |
| 24 | run: | |
| 25 | pip install .[all] |
| 26 | - name: Update example images |
| 27 | run: | |
| 28 | python getting_started.py |
| 29 | for f in examples/*.py; do |
| 30 | if [ -x $f ]; then |
| 31 | $f --save |
| 32 | fi |
| 33 | done |
| 34 | - name: Update README.md |
| 35 | run: | |
| 36 | ./generate_readme.py > README.md |
| 37 | - name: Push changes |
| 38 | run: | |
| 39 | git config --global user.email "[email protected]" |
| 40 | git config --global user.name "Kentaro Wada" |
| 41 | git add examples/.readme README.md |
| 42 | git diff-index --cached --quiet HEAD || git commit -m "Update README.md and images" |
| 43 | git push origin main |