Merge pull request #479 from satyamyadav979/patch-1 #24
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: Deploy Javadocs to GitHub Pages | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Change wrapper permissions | |
| run: chmod +x pi4micronaut-utils/gradlew | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} | |
| - name: Generate Javadocs | |
| working-directory: pi4micronaut-utils | |
| run: ./gradlew javadoc | |
| - name: Upload javadoc artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: javadoc | |
| path: pi4micronaut-utils/build/docs/javadoc | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download javadoc artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: javadoc | |
| path: ./javadoc | |
| retention-days: 1 | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| if: github.ref == 'refs/heads/develop' | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./javadoc | |
| destination_dir: javadoc | |
| keep_files: true | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' |