build(deps-dev): bump @types/node from 26.1.2 to 26.2.0 in /docs #332
Workflow file for this run
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: 📖 Docs CI | |
| on: | |
| pull_request: | |
| paths: | |
| - "docs/**" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: 🩹 Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install dependencies | |
| working-directory: docs | |
| run: npm ci | |
| - name: Lint docs | |
| working-directory: docs | |
| run: npm run lint | |
| - name: Run docs tests | |
| working-directory: docs | |
| run: npm test | |
| build: | |
| name: 🏗️ Build | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install dependencies | |
| working-directory: docs | |
| run: npm ci | |
| - name: Build | |
| working-directory: docs | |
| env: | |
| DOCS_VERSION: main | |
| run: npm run docs:build | |
| # Keep in sync with the preview job's condition below — no point uploading | |
| # a dist nothing will deploy. | |
| - name: Upload dist for preview deploy | |
| if: >- | |
| github.event_name == 'pull_request' | |
| && github.event.pull_request.head.repo.full_name == github.repository | |
| && github.event.pull_request.user.login != 'dependabot[bot]' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: docs-dist | |
| path: docs/.vitepress/dist | |
| retention-days: 1 | |
| # Forks and Dependabot are both excluded because neither can read the | |
| # Cloudflare secrets: forks get no secrets at all, and Dependabot-triggered | |
| # runs read a separate Dependabot secret store that does not hold them. | |
| # Without this the deploy fails with an empty CLOUDFLARE_API_TOKEN. | |
| preview: | |
| name: 🔍 Preview | |
| needs: build | |
| if: >- | |
| github.event_name == 'pull_request' | |
| && github.event.pull_request.head.repo.full_name == github.repository | |
| && github.event.pull_request.user.login != 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Download dist | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: docs-dist | |
| path: dist | |
| - name: Deploy preview to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v4 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| wranglerVersion: "4" | |
| command: pages deploy dist --project-name=mediawiki-skins-citizen --branch=pr-${{ github.event.pull_request.number }} --commit-dirty=true | |
| # Sticky comment: find-and-update via the hidden marker instead of posting a new comment per run | |
| - name: Comment preview URL | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR: ${{ github.event.pull_request.number }} | |
| URL: https://pr-${{ github.event.pull_request.number }}.mediawiki-skins-citizen.pages.dev | |
| SHA: ${{ github.event.pull_request.head.sha }} | |
| run: | | |
| MARKER="<!-- docs-preview-comment -->" | |
| BODY="$(printf '%s\nDocs preview: %s (built from %s)' "$MARKER" "$URL" "$SHA")" | |
| COMMENT_ID=$(gh api --paginate "repos/$GITHUB_REPOSITORY/issues/$PR/comments" \ | |
| --jq ".[] | select(.body | startswith(\"$MARKER\")) | .id" | head -n1) | |
| if [ -n "$COMMENT_ID" ]; then | |
| gh api -X PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID" -f body="$BODY" | |
| else | |
| gh api "repos/$GITHUB_REPOSITORY/issues/$PR/comments" -f body="$BODY" | |
| fi |