-
Notifications
You must be signed in to change notification settings - Fork 246
82 lines (69 loc) · 2.02 KB
/
test-website-links.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
name: Website
on:
push:
branches: ["v3"]
pull_request:
branches: ["main"]
paths:
- 'docs/**'
- ".github/workflows/test-website-links.yml"
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test:
name: test URLs
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: docs
ruby-version: 3.3
- name: Install GEMs
working-directory: docs
env:
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile
run: |
pwd
bundle install
- name: Setup HTML Proofer
run: |
gem install html-proofer
htmlproofer --help
- name: Replace "data-src"
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "data-src"
replace: "src"
regex: false
- name: Replace "dotnet.stockindicators.dev"
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "https://dotnet.stockindicators.dev"
replace: "http://127.0.0.1:4000"
regex: false
- name: Build site
working-directory: docs
env:
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile
run: bundle exec jekyll build --trace
- name: Serve site
working-directory: docs
env:
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile
run: bundle exec jekyll serve --detach
# see help in setup step
- name: Test for broken URLs
working-directory: docs
run: |
htmlproofer _site \
--no-enforce-https \
--no-check-external-hash \
--ignore-status-codes "0,302,403,406,408,429,503,999" \
--swap-urls "https\://dotnet.stockindicators.dev:http\://127.0.0.1:4000" \
--ignore-urls "/fonts.gstatic.com/"
- name: Kill site (failsafe)
if: always()
run: pkill -f jekyll