feat(docs): use versioned MCPB download links with __VERSION__ placeh… #53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - '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' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| 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.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@v3 | |
| with: | |
| path: 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@v4 | |
| id: deployment | |
| deploy-worker: | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy Cloudflare Worker | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: docs/worker |