Skip to content

Deploy Documentation #342

Deploy Documentation

Deploy Documentation #342

Workflow file for this run

name: Deploy Documentation
on:
push:
branches: [main]
paths:
- 'packages/gitlab-mcp/docs/**'
- 'packages/gitlab-mcp/package.json'
- 'yarn.lock'
- '.github/workflows/docs.yml'
workflow_run:
workflows: ["CI/CD Pipeline"]
types: [completed]
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
if: >
github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success'
# docs/, vitepress, and the docs scripts live in the core package; run the
# docs steps from there. (uses: steps below set explicit paths where needed.)
defaults:
run:
working-directory: packages/gitlab-mcp
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Build project
run: yarn build
- name: Download latest MCPB bundle
id: mcpb
run: |
mkdir -p docs/public/downloads
LATEST_TAG=$(gh release view --json tagName --jq '.tagName' 2>/dev/null || echo "")
if [ -n "$LATEST_TAG" ]; then
VERSION="${LATEST_TAG#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
gh release download "$LATEST_TAG" --pattern "*.mcpb" --dir docs/public/downloads/ || true
MCPB_FILE="docs/public/downloads/gitlab-mcp-${VERSION}.mcpb"
if [ -f "$MCPB_FILE" ]; then
echo "MCPB bundle included: ${VERSION}"
fi
else
# Fallback to package.json version if no release exists
VERSION=$(jq -r '.version' package.json)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "MCPB bundle version from package.json: ${VERSION}"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate dynamic documentation
run: |
yarn list-tools --export --toc > docs/tools/api-reference.md
yarn inject-tool-refs
env:
RELEASE_VERSION: ${{ steps.mcpb.outputs.version }}
- name: Build documentation
run: yarn docs:build
env:
DOCS_BASE: /
- name: Run tests with coverage
run: yarn test:cov
- name: Integrate coverage into docs
run: |
mkdir -p docs/.vitepress/dist/coverage
cp -r coverage/lcov-report/* docs/.vitepress/dist/coverage/
- uses: actions/upload-pages-artifact@v5
with:
path: packages/gitlab-mcp/docs/.vitepress/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v5
id: deployment