-
Notifications
You must be signed in to change notification settings - Fork 26
32 lines (22 loc) · 1.13 KB
/
linkchecker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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}