ci: simplify pnpm setup by using built-in node caching #57
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: build | |
on: | |
push: | |
branches: | |
- main | |
permissions: write-all | |
jobs: | |
build: | |
if: github.repository == 'my-mcp-hub/mcp-kit' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PNPM | |
uses: ./.github/actions/setup-pnpm | |
with: | |
node-version: 22 | |
npm-token: ${{ secrets.NPM_TOKEN }} | |
- name: Build Package | |
run: pnpm run build | |
- name: Test Package | |
run: pnpm run coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
doc: | |
if: github.repository == 'my-mcp-hub/mcp-kit' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PNPM | |
uses: ./.github/actions/setup-pnpm | |
with: | |
node-version: 22 | |
npm-token: ${{ secrets.NPM_TOKEN }} | |
- name: Build Docs Package | |
run: pnpm run docs:build | |
- name: Deploy Docs | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/.vitepress/dist | |
- name: Get the content of algolia.json as config | |
id: algolia_config | |
run: echo "config=$(cat docs/crawlerConfig.json | jq -r tostring)" >> $GITHUB_OUTPUT | |
- name: Push indices to Algolia | |
uses: signcl/docsearch-scraper-action@master | |
env: | |
APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }} | |
API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
CONFIG: ${{ steps.algolia_config.outputs.config }} |