-
Notifications
You must be signed in to change notification settings - Fork 248
70 lines (58 loc) · 1.64 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
name: Website URLs
on:
pull_request:
branches: ["*"]
paths:
- docs/**
- .github/workflows/test-website-links.yml
# Prevent multiple concurrent runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
env:
BUNDLE_GEMFILE: ${{github.workspace}}/docs/Gemfile
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Install dependencies
run: |
bundle install
gem install html-proofer
- name: Replace "data-src"
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "data-src"
replace: "src"
regex: false
- name: Use 'localhost'
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "https://dotnet.stockindicators.dev"
replace: "http://127.0.0.1:4000"
regex: false
- name: Build site
run: bundle exec jekyll build
- name: Serve site
run: bundle exec jekyll serve --port 4000 --detach
# see help in setup step
- name: Test for broken URLs
run: >
htmlproofer _site
--no-enforce-https
--no-check-external-hash
--ignore-status-codes "0,302,403,406,408,429,503,999"
--ignore-urls "/fonts.gstatic.com/"
- name: Kill site (failsafe)
if: always()
run: pkill -f jekyll