Merge pull request #5 from KW-AUTA/feature/3 #7
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: Build and Deploy API Docs | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout dev branch | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Grant execute permission to Gradlew | |
| run: chmod +x ./gradlew | |
| - name: Build with asciidoctor | |
| run: ./gradlew clean build asciidoctor | |
| - name: Ensure docs directory exists | |
| run: mkdir -p docs | |
| - name: Copy asciidoc output to docs folder | |
| run: cp -r build/docs/asciidoc/* docs/ | |
| - name: Commit and push updated docs | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "GitHub Actions" | |
| git add docs/ | |
| git commit -m "Update API Docs [skip ci]" || echo "No changes to commit" | |
| git push origin dev |