Bump version to 1.0.8 and update workflow #5
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: π Auto Update Documentation | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| paths: | |
| - '**/*.md' | |
| - 'docs/**/*' | |
| pull_request: | |
| branches: [main, master, develop] | |
| paths: | |
| - '**/*.md' | |
| - 'docs/**/*' | |
| jobs: | |
| update-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| cache: 'pip' | |
| - name: π¦ Install update-docs-system | |
| run: | | |
| pip install update-docs-system | |
| - name: π Check for .md changes | |
| id: check_changes | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) | |
| else | |
| CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "") | |
| fi | |
| if echo "$CHANGED_FILES" | grep -E '\\.md$'; then | |
| echo "md_changed=true" >> $GITHUB_OUTPUT | |
| echo "π Markdown files changed, updating documentation..." | |
| echo "Changed files:" | |
| echo "$CHANGED_FILES" | grep -E '\\.md$' | |
| else | |
| echo "md_changed=false" >> $GITHUB_OUTPUT | |
| echo "βΉοΈ No markdown files changed" | |
| fi | |
| - name: π Update documentation | |
| if: steps.check_changes.outputs.md_changed == 'true' | |
| run: | | |
| update-docs --docs docs --content-json content/Content.json --description-md content/Description_for_agents.md | |
| echo "β Documentation updated successfully" | |
| - name: πΎ Commit updated documentation | |
| if: steps.check_changes.outputs.md_changed == 'true' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action Bot" | |
| mkdir -p content | |
| git add content/Content.json content/Description_for_agents.md docs/ || true | |
| if git diff --staged --quiet; then | |
| echo "βΉοΈ No changes to commit" | |
| else | |
| git commit -m "π Auto-update documentation" | |
| if [ "${{ github.event_name }}" != "pull_request" ]; then | |
| git push | |
| echo "β Documentation committed and pushed" | |
| fi | |
| fi | |
| - name: π Summary | |
| if: steps.check_changes.outputs.md_changed == 'true' | |
| run: | | |
| echo "## π Documentation Update Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "- β Content.json updated" >> $GITHUB_STEP_SUMMARY | |
| echo "- β Description_for_agents.md refreshed" >> $GITHUB_STEP_SUMMARY | |
| echo "- β Navigation links added" >> $GITHUB_STEP_SUMMARY |