name: Docs on: push: branches: - main - '*-1.0' - 'dev-*' paths: - '.github/**' - '*gradle*' - 'docs/**' - 'gradle/**' pull_request: branches: - main - '*-1.0' - 'dev-*' paths: - '.github/**' - '*gradle*' - 'docs/**' - 'gradle/**' jobs: # Runs on PRs and push to ensure the documentation successfully builds. build: name: Build Documentation runs-on: ubuntu-latest env: JAVA_VERSION: 22 steps: - name: Check out project uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} - name: Set up Gradle uses: gradle/actions/setup-gradle@v3 - name: Build docs run: ./gradlew buildDocs - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: docs/build # Deploys the documentation if this is a push to the main branch. deploy: name: Deploy Documentation if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: pages: write # to deploy to Pages id-token: write # to verify the deployment originates from an appropriate source # Deploy to the github-pages environment environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4