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

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