Skip to content

Commit 99ef35b

Browse files
authored
Merge pull request #31 from CardanoGateKeeper/fix/modify-cd-for-documentation
Update CD workflows for API documentation and publication to mainnet …
2 parents ea84aea + 60eb016 commit 99ef35b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
- 'README.md'
710
jobs:
811
deploy-production:
912
runs-on: ubuntu-latest

.github/workflows/publish-api.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ jobs:
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
@@ -23,3 +28,19 @@ jobs:
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

0 commit comments

Comments
 (0)