Merge pull request #140 from sebj/dependabot/github_actions/actions/c… #174
This file contains 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, Test and Deploy Documentation | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
Build-Test-Documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4.2.1 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} | |
- name: Cache Gradle wrapper | |
uses: actions/cache@v4.2.1 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '18' | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Test with Gradle | |
run: ./gradlew jvmTest | |
- name: Generate API documentation | |
run: ./gradlew dokkaHtml | |
- name: Deploy API documentation to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4.7.3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FOLDER: build/dokka |