Merge pull request #181 from jonathanhefner/generate-api-docs
Add API documentation with GitHub Pages deployment
This commit is contained in:
commit
00392b660d
2 changed files with 202 additions and 0 deletions
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue