| 1 | name: Build Vitepress docs |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | - release/* |
| 8 | pull_request: |
| 9 | merge_group: |
| 10 | |
| 11 | concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 12 | |
| 13 | permissions: |
| 14 | contents: read |
| 15 | |
| 16 | jobs: |
| 17 | build-docs: |
| 18 | runs-on: ubuntu-latest |
| 19 | steps: |
| 20 | - name: Checkout |
| 21 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 22 | |
| 23 | - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 |
| 24 | |
| 25 | - name: Setup Node.js |
| 26 | uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 |
| 27 | with: |
| 28 | cache: pnpm |
| 29 | node-version-file: '.node-version' |
| 30 | |
| 31 | - name: Install Packages |
| 32 | run: pnpm install --frozen-lockfile |
| 33 | |
| 34 | - name: Verify release version |
| 35 | if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release')) }} |
| 36 | run: pnpm --filter mermaid run docs:verify-version |
| 37 | |
| 38 | - name: Run Build |
| 39 | run: pnpm --filter mermaid run docs:build:vitepress |
| 40 | |