README improvements #15
This file contains hidden or 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: Update Documentation | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'packages/locorda/example/**/*.dart' | |
| - 'packages/locorda/example/**/*.md' | |
| - '.github/workflows/update-docs.yml' | |
| jobs: | |
| update-code-excerpts: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - name: Get dependencies | |
| run: | | |
| cd packages/locorda/example | |
| dart pub get | |
| - name: Update code excerpts in documentation | |
| run: | | |
| cd packages/locorda/example/mini | |
| dart run excerpter README.md | |
| cd ../personal_notes_app | |
| dart run excerpter README.md | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| git diff --quiet packages/locorda/example/ && echo "changed=false" >> $GITHUB_OUTPUT || echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Commit updated documentation | |
| if: steps.check_changes.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add packages/locorda/example/ | |
| git commit -m "docs(example): auto-update code excerpts [skip ci]" | |
| git push |