refactor(gha): improve link checks (#53) #135
This file contains 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
name: hugo-build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
hugo-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 0.89.4 | |
- name: Build | |
run: | | |
hugo --gc | |
cp LICENSE README.md public/ | |
echo "${{ github.event.repository.name }}" > public/CNAME | |
- name: Check broken links | |
uses: ruzickap/action-my-broken-link-checker@v2 | |
with: | |
url: https://${{ github.event.repository.name }} | |
pages_path: public | |
cmd_params: '--exclude=(linkedin.com|https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/tree/main/static/presentations/|https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/blob/main/static/presentations/) --max-connections-per-host=5 --color=always --rate-limit=5 --header="User-Agent:curl/7.54.0" --skip-tls-verification' | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
force_orphan: true |