Merge pull request #181 from jonathanhefner/generate-api-docs

Add API documentation with GitHub Pages deployment
This commit is contained in:
Koichi ITO 2025-11-27 12:54:46 +09:00 • committed by GitHub
commit 00392b660d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 202 additions and 0 deletions

View file

@ -31,3 +31,14 @@ jobs:
ruby-version: 3.2 # Specify the oldest supported Ruby version.
bundler-cache: true
- run: bundle exec rake rubocop
yard:
runs-on: ubuntu-latest
name: YARD Documentation
steps:
- uses: actions/checkout@v5
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2 # Specify the oldest supported Ruby version.
bundler-cache: true
- run: bundle exec yard --no-output

View file

@ -23,3 +23,35 @@ jobs:
bundler-cache: true
ruby-version: 3.4
- uses: rubygems/release-gem@v1
publish_gh_pages:
if: github.repository_owner == 'modelcontextprotocol'
name: Publish Documentation to GitHub Pages
runs-on: ubuntu-latest
needs: [publish_gem]
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Get version tag
id: version
run: |
git fetch --tags
TAG=$(git describe --tags --exact-match HEAD)
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Generate GitHub Pages
run: ./bin/generate-gh-pages.sh ${{ steps.version.outputs.tag }}
- name: Push to gh-pages
run: git push origin gh-pages