File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7+ paths-ignore :
8+ - ' docs/**'
9+ - ' README.md'
710jobs :
811 deploy-production :
912 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 77 build-docs :
88 runs-on : ubuntu-latest
99
10+ permissions :
11+ contents : write
12+
1013 steps :
1114 - name : Checkout repo
1215 uses : actions/checkout@v4
16+ with :
17+ token : ${{ secrets.GITHUB_TOKEN }}
1318
1419 - name : Setup PHP
1520 uses : shivammathur/setup-php@v2
2328
2429 - name : Generate Scribe docs
2530 run : php artisan scribe:generate
31+
32+ - name : Commit and push docs if changed
33+ run : |
34+ git config user.name "github-actions[bot]"
35+ git config user.email "github-actions[bot]@users.noreply.github.com"
36+
37+ # Check for changes under docs/ (adjust path if needed)
38+ if [ -n "$(git status --porcelain docs)" ]; then
39+ echo "Docs changed, committing..."
40+ git add docs
41+
42+ git commit -m "Update API docs [skip ci]" || echo "No changes to commit"
43+ git push
44+ else
45+ echo "No changes in docs/, nothing to commit."
46+ fi
You can’t perform that action at this time.
0 commit comments