dockerfile: containerized htmlproofer

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-05-09 15:08:40 +02:00
parent dc1a99b7b0
commit 8da7d9445d
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
6 changed files with 44 additions and 12 deletions

View File

@ -84,19 +84,10 @@ jobs:
name: Checkout
uses: actions/checkout@v3
-
name: Build
name: Check for broken links
uses: docker/bake-action@v2
with:
targets: release
-
name: Check for broken links
uses: chabad360/htmlproofer@master
with:
directory: ./_site
# for available options, refer to:
# - https://github.com/gjtorikian/html-proofer
# - https://github.com/gjtorikian/html-proofer/blob/main/bin/htmlproofer
arguments: --disable-external --internal-domains="docs.docker.com,docs-stage.docker.com,localhost:4000" --file-ignore="/^./_site/engine/api/.*$/,./_site/registry/configuration/index.html" --url-ignore="/^/docker-hub/api/latest/.*$/,/^/engine/api/v.+/#.*$/,/^/glossary/.*$/"
targets: htmlproofer
# Disabled netlify-deploy due to flakey 502 http errors
# - name: copy static files

View File

@ -92,6 +92,15 @@ find ${TARGET} -type f -name '*.html' | while read i; do
done
EOT
# htmlproofer checks for broken links
FROM gem AS htmlproofer
RUN --mount=type=bind,from=generate,source=/out,target=_site \
htmlproofer ./_site \
--disable-external \
--internal-domains="docs.docker.com,docs-stage.docker.com,localhost:4000" \
--file-ignore="/^./_site/engine/api/.*$/,./_site/registry/configuration/index.html" \
--url-ignore="/^/docker-hub/api/latest/.*$/,/^/engine/api/v.+/#.*$/,/^/glossary/.*$/"
# Release the generated files in a scratch image
# Can be output to your host with:
# > make release

View File

@ -6,3 +6,4 @@ gem 'jekyll'
gem 'jekyll-redirect-from'
gem 'jekyll-relative-links'
gem 'jekyll-sitemap'
gem 'html-proofer'

View File

@ -8,9 +8,19 @@ GEM
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.15.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
html-proofer (3.19.3)
addressable (~> 2.3)
mercenary (~> 0.3)
nokogiri (~> 1.12)
parallel (~> 1.3)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
http_parser.rb (0.8.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
@ -48,9 +58,14 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.13.5-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.0)
rainbow (3.1.1)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
@ -61,7 +76,10 @@ GEM
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
unicode-display_width (1.8.0)
yell (2.2.2)
PLATFORMS
aarch64-linux
@ -69,6 +87,7 @@ PLATFORMS
x86_64-linux
DEPENDENCIES
html-proofer
jekyll
jekyll-redirect-from
jekyll-relative-links

View File

@ -29,9 +29,13 @@ release:
vendor:
$(BUILDX_CMD) bake vendor
# Check for broken links
htmlproofer:
$(BUILDX_CMD) bake htmlproofer
# Deploy website and run it through Docker compose
# Available in your browser at http://localhost:4000
deploy:
docker compose up --build
.PHONY: buildx-yaml release vendor deploy
.PHONY: buildx-yaml release vendor htmlproofer deploy

View File

@ -19,3 +19,11 @@ target "vendor" {
target = "vendor"
output = ["."]
}
target "htmlproofer" {
target = "htmlproofer"
args = {
JEKYLL_ENV = JEKYLL_ENV
}
output = ["type=cacheonly"]
}