Skip to content

Run linkchecker on site #1720

Run linkchecker on site

Run linkchecker on site #1720

Workflow file for this run

name: Run linkchecker on site
on:
schedule:
- cron: '0 19 * * *'
env:
PORT: 8010
jobs:
run-linkchecker:
if: github.repository == 'canonical-web-and-design/cn.ubuntu.com'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: DOCKER_BUILDKIT=1 docker build --build-arg BUILD_ID=test --tag cn.ubuntu.com .
- name: Run server with Docker
run: docker run -p ${PORT}:80 --env SECRET_KEY=insecure_secret_key cn.ubuntu.com &
- name: Check server status
run: curl localhost:${PORT}/_status/check -I
- name: Install linkchecker
run: sudo apt update && sudo apt install linkchecker
- name: Run linkchecker on live site
run: linkchecker --threads 2 --no-warnings --check-extern --ignore-url /blog --ignore-url https://assets.ubuntu.com$ --ignore-url ".*(?:png|jpg|jpeg|gif|bmp|svg|js)$" --ignore-url /f_auto --ignore-url /q_auto --ignore-url /fl_sanitize --ignore-url /w_* --ignore-url /h_* --ignore-url https://www.gstatic.com$ --ignore-url https://res.cloudinary.com$ --ignore-url googleusercontent.com http://localhost:${PORT}