Add link check action #2
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
| # Workflow for building and link checking the Hugo site on PRs | |
| name: Build and Link Check | |
| on: | |
| # Runs on pull requests targeting the dev branch | |
| pull_request: | |
| branches: ["dev"] | |
| # Allows running this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Default to bash | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| # Build and Link Check job | |
| build_and_link_check: | |
| runs-on: ubuntu-latest | |
| env: | |
| HUGO_VERSION: 0.128.0 | |
| steps: | |
| - name: Install Hugo CLI | |
| run: | | |
| wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ | |
| && sudo dpkg -i ${{ runner.temp }}/hugo.deb | |
| - name: Install Dart Sass | |
| run: sudo snap install dart-sass | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Node.js dependencies | |
| run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" | |
| - name: Build with Hugo | |
| env: | |
| HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache | |
| HUGO_ENVIRONMENT: production | |
| run: | | |
| hugo --minify | |
| - name: Link Checker | |
| id: lychee | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| fail: false | |
| args: --verbose --exclude "https://example.com" public |