Flag updated docs #117
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: Flag updated docs | |
| on: | |
| schedule: | |
| - cron: "30 3 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| mark-updated-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Mark recently updated docs | |
| env: | |
| SIGNIFICANT_LINE_THRESHOLD: "20" | |
| WINDOW_DAYS: "30" | |
| run: python .github/scripts/mark_recent_docs.py | |
| - name: Detect changes | |
| id: changes | |
| run: | | |
| if git status --porcelain | grep .; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit and push updates | |
| if: steps.changes.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add user-guide developer-guide | |
| git commit -m "chore: update sidebar highlights for docs" | |
| git push | |
| - name: Set up Node.js | |
| if: steps.changes.outputs.changed == 'true' | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20.x | |
| cache: npm | |
| - name: Install dependencies | |
| if: steps.changes.outputs.changed == 'true' | |
| run: npm ci | |
| - name: Build website | |
| if: steps.changes.outputs.changed == 'true' | |
| run: npm run build | |
| - name: Deploy to GitHub Pages | |
| if: steps.changes.outputs.changed == 'true' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./build | |
| user_name: github-actions[bot] | |
| user_email: 41898282+github-actions[bot]@users.noreply.github.com |