Skip to content

Update apidocs.yaml workflow to refine triggers and deployment conditions #8

Update apidocs.yaml workflow to refine triggers and deployment conditions

Update apidocs.yaml workflow to refine triggers and deployment conditions #8

Workflow file for this run

name: Build and Publish API Docs to GitHub Pages
on:
release:
types:
- published
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
pull_request:
jobs:
deploy:
permissions:
pages: write # to deploy to Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Generate Dokka Site
run: |-
./gradlew clean dokkaGenerate
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: build/dokka/html
- name: Deploy to GitHub Pages
id: deployment
if: ${{ github.repository == 'modelcontextprotocol/kotlin-sdk' && ((github.event_name == 'release' && github.event.action == 'published') || github.event_name == 'workflow_dispatch') }}
uses: actions/deploy-pages@v4