docs_lint.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Docs Lint
  2. on:
  3. pull_request:
  4. paths:
  5. - 'docs/docs-site/**'
  6. jobs:
  7. link-check:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout
  11. uses: actions/checkout@v4
  12. - name: Install Hugo
  13. run: |
  14. curl -sL https://github.com/gohugoio/hugo/releases/download/v0.69.0/hugo_0.69.0_Linux-64bit.tar.gz -o hugo.tar.gz
  15. tar -xzf hugo.tar.gz
  16. sudo mv hugo /usr/local/bin/
  17. - name: Build & serve Hugo site
  18. working-directory: docs/docs-site
  19. run: |
  20. hugo server --port 1313 --bind 127.0.0.1 --watch=false &> /tmp/hugo.log &
  21. echo "Hugo PID: $!"
  22. sleep 5
  23. - name: Run Lychee link check
  24. id: lychee
  25. uses: lycheeverse/lychee-action@v2
  26. with:
  27. # point at your local server URL
  28. args: http://localhost:1313/ --exclude "https://issues.cloudera.org*|http://localhost:8005|http://localhost:5555*|https://issues.apache.org/jira*|https://github.com*|http://demo.gethue.com*|https://twitter.com/gethue|https://cdn.gethue.com/downloads/*|https://pypi.org*"
  29. fail: true # fail the job if any broken links are found
  30. format: markdown
  31. - name: Tear down Hugo
  32. if: always()
  33. run: pkill hugo || true