github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/.github/workflows/pr-documentation.yml (about)

     1  name: Check Documentation
     2  
     3  on:
     4    pull_request:
     5  
     6  jobs:
     7  
     8    doc:
     9      name: Build documentation
    10      runs-on: ubuntu-latest
    11      env:
    12        GO_VERSION: '1.21'
    13        NODE_VERSION: '20.x'
    14        CGO_ENABLED: 0
    15  
    16      steps:
    17        - name: Check out code
    18          uses: actions/checkout@v4
    19          with:
    20            fetch-depth: 0
    21  
    22        - name: Set up Go ${{ env.GO_VERSION }}
    23          uses: actions/setup-go@v5
    24          with:
    25            go-version: ${{ env.GO_VERSION }}
    26  
    27        - name: Cache Go modules
    28          uses: actions/cache@v4
    29          with:
    30            # In order:
    31            # * Module download cache
    32            # * Build cache (Linux)
    33            path: |
    34              ~/go/pkg/mod
    35              ~/.cache/go-build
    36            key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    37            restore-keys: |
    38              docs-${{ runner.os }}-go-
    39  
    40        - run: go mod download
    41  
    42        - name: Use Node.js ${{ env.NODE_VERSION }}
    43          uses: actions/setup-node@v4
    44          with:
    45            node-version: ${{ env.NODE_VERSION }}
    46            cache: npm
    47            cache-dependency-path: docs/package-lock.json
    48  
    49        - run:  npm install --legacy-peer-deps
    50          working-directory: ./docs
    51  
    52        - name: Build Documentation
    53          run: npm run build
    54          working-directory: ./docs