simplify the fern workflow, no publishing #13
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
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # Fern Documentation Workflow | |
| # | |
| # Validates Fern configuration and checks for broken links on PRs that touch | |
| # docs/** or fern/** files. | |
| # | |
| # Runs fern check and fern docs broken-links — no publishing or artifact generation. | |
| name: Fern Docs | |
| on: | |
| push: | |
| branches: | |
| - "pull-request/[0-9]+" | |
| workflow_dispatch: | |
| jobs: | |
| changed-files: | |
| runs-on: linux-amd64-cpu32 | |
| permissions: | |
| contents: read | |
| outputs: | |
| docs: ${{ steps.changes.outputs.docs }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for docs changes | |
| id: changes | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "docs=true" >> $GITHUB_OUTPUT | |
| elif [ "${{ github.event.before }}" = "0000000000000000000000000000000000000000" ]; then | |
| echo "docs=true" >> $GITHUB_OUTPUT | |
| elif git diff --name-only "${{ github.event.before }}" HEAD 2>/dev/null | grep -qE '^(docs/|fern/)'; then | |
| echo "docs=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "docs=false" >> $GITHUB_OUTPUT | |
| fi | |
| fern-check: | |
| name: Fern Configuration Check | |
| needs: changed-files | |
| if: needs.changed-files.outputs.docs == 'true' | |
| runs-on: linux-amd64-cpu32 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install Fern CLI | |
| run: npm install -g fern-api@4.23.0 | |
| - name: Validate Fern configuration | |
| run: fern check | |
| fern-broken-links: | |
| name: Fern Broken Links Check | |
| needs: changed-files | |
| if: needs.changed-files.outputs.docs == 'true' | |
| runs-on: linux-amd64-cpu32 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install Fern CLI | |
| run: npm install -g fern-api@4.23.0 | |
| - name: Check for broken links | |
| run: fern docs broken-links |