-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (66 loc) · 2.19 KB
/
Copy pathchecks.yml
File metadata and controls
70 lines (66 loc) · 2.19 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Run Checks
on:
workflow_dispatch:
# push:
# branches: [ main, dev ]
# paths: docs/**
pull_request:
branches: [ main ]
paths: docs/**
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
working-directory: ./docs
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Build with Jekyll
run: bundle exec jekyll build
working-directory: ./docs
- name: Check online links (lychee)
uses: lycheeverse/lychee-action@v2
with:
args: >-
--offline --include-fragments
--fallback-extensions html
--index-files 'index.html,.'
--root-dir ${{ github.workspace }}/docs/_site
./_site
workingDirectory: ./docs
fail: true
- name: Set up Python for offline link check
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install Python deps
run: pip install -r requirements.txt
- name: Check offline links (check_links.py)
run: >-
python scripts/check_links.py
--offline --include-fragments
--index-files index.html
--root-dir docs/_site-offline
docs/_site-offline
- name: Check for surviving live-site links in offline tree
# Flags any https://docs.twinbasic.com/<path> reference left in
# _site-offline/ HTML outside <code>/<pre> blocks. After offlinify
# strips the jekyll-seo-tag block, anything surviving is a source
# link that points at the live site instead of using a relative or
# /tB/... permalink that resolves locally. The bare root URL
# (https://docs.twinbasic.com[/]) is exempt -- intentional "go to
# the live site" links are allowed.
run: python scripts/check_offline_live_links.py