Test for broken internal links in CI

This commit is contained in:
Jeff Dairiki 2022-02-27 14:38:54 -08:00
parent 65d03ec753
commit bab7d5e497
2 changed files with 31 additions and 6 deletions

View File

@ -12,12 +12,19 @@ on:
schedule: schedule:
- cron: '23 2 * * *' - cron: '23 2 * * *'
env:
DEPLOY: >-
${{
github.event_name != 'pull_request'
&&
github.ref == 'refs/heads/master'
}}
OUTPUT: _html
jobs: jobs:
deploy-lektor-website: build:
name: Deploy lektor website name: Build lektor website
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
DEPLOY: ${{ github.event_name != 'pull_request' }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -28,10 +35,20 @@ jobs:
python -m pip install --upgrade pip setuptools python -m pip install --upgrade pip setuptools
python -m pip install lektor python -m pip install lektor
- run: lektor build - name: Build lektor website
run: lektor build -O '${{ env.OUTPUT }}'
- run: lektor deploy ghpages-https - name: Check for broken internal links
uses: wjdp/htmltest-action@master
with:
path: ${{ env.OUTPUT }}
config: .htmltest.yml
skip_external: true
log_level: 1
- name: Deploy lektor website
if: env.DEPLOY == 'true' if: env.DEPLOY == 'true'
run: lektor deploy -O '${{ env.OUTPUT }}' ghpages-https
env: env:
LEKTOR_DEPLOY_USERNAME: lektor LEKTOR_DEPLOY_USERNAME: lektor
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

8
.htmltest.yml Normal file
View File

@ -0,0 +1,8 @@
IgnoreAltMissing: true
IgnoreURLs:
- "^http://localhost:"
# htmltest does not like quotes around URL in meta refresh
CheckMetaRefresh: false
# our redirect page doesn't have a doctype
CheckDoctype: false