Skip to content

Commit

Permalink
Install hazelcast-docs-tools (#430)
Browse files Browse the repository at this point in the history
# Description of change

- Use all utility scripts from hazelcast-docs-tools
- Add orphan-pages check to the "validate" reusable action
- Add params for the "validate" reusable action

---------

Co-authored-by: Oliver Howell <[email protected]>
  • Loading branch information
fantkolja and oliverhowell authored Jan 10, 2025
1 parent db885c4 commit 7ad74cd
Show file tree
Hide file tree
Showing 24 changed files with 93 additions and 408 deletions.
29 changes: 22 additions & 7 deletions .github/actions/validate/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
name: Validate
description: Check for dead links
description: Validate Docs

inputs:
orphan-checker-directory:
description: Directory parameter (--directory) for check-orphan-pages
required: false
default: docs
orphan-checker-log-failure-level:
description: Failure level parameter (--log-failure-level) for check-orphan-pages
required: false
default: error
check-links-loader-log-level:
description: Log level parameter (--log-level) for load-check-links-playbook
required: false
default: log

runs:
using: 'composite'
Expand All @@ -15,17 +29,18 @@ runs:
repository: hazelcast/hazelcast-docs
sparse-checkout: |
antora-playbook.yml
lib/load-check-links-playbook.js
lib/antora-link-checker-extension.js
sparse-checkout-cone-mode: false
path: hazelcast-docs
ref: main

- name: Check for broken internal links
shell: bash
run: |
cp "./hazelcast-docs/lib/load-check-links-playbook.js" "./load-check-links-playbook.js"
npm i
npm i -D [email protected] [email protected]
node load-check-links-playbook.js $GITHUB_REPOSITORY $GITHUB_BASE_REF
./node_modules/.bin/antora --fetch --to-dir test --log-level=warn --log-failure-level=warn --extension=hazelcast-docs/lib/antora-link-checker-extension.js check-links-playbook.yml
npm i -D hazelcast/hazelcast-docs-tools#v1.1.0 [email protected] [email protected]
load-check-links-playbook -r $GITHUB_REPOSITORY -b $GITHUB_BASE_REF --log-level ${{ inputs.check-links-loader-log-level }}
./node_modules/.bin/antora --fetch --to-dir test --log-level=warn --log-failure-level=warn --extension=./node_modules/hazelcast-docs-tools/antora-extensions/antora-link-checker-extension.js check-links-playbook.yml
- name: Check orphan pages
shell: bash
run: check-orphan-pages -d ${{ inputs.orphan-checker-directory }} --log-failure-level ${{ inputs.orphan-checker-log-failure-level }}
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ jobs:
uses: actions/checkout@v4
- name: Check dead links
uses: hazelcast/hazelcast-docs/.github/actions/validate@main
with:
orphan-checker-directory: "Some literal string"


2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ For this to happen we have several common files in the link:https://github.com/h
|link:https://github.com/hazelcast/hazelcast-docs/blob/main/.github/actions/validate/action.yml[action.yml]
|Contains common parts of the links checker workflow

|link:https://github.com/hazelcast/hazelcast-docs/blob/main/lib/load-check-links-playbook.js[load-check-links-playbook.js]
|link:https://github.com/hazelcast/hazelcast-docs-tools/blob/v1.0.0/scripts/check-links-playbook-loader.js[load-check-links-playbook.js]
|Responsible for modification of `content.sources` from the global `antora-playbook.yml`.
|===

Expand Down
6 changes: 3 additions & 3 deletions antora-playbook-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ ui:
snapshot: true
antora:
extensions:
- require: ./lib/api_json.js
- require: ./node_modules/hazelcast-docs-tools/antora-extensions/api-json.js
tags:
- Favorites
- Videos
Expand Down Expand Up @@ -273,6 +273,6 @@ asciidoc:
ucn: User Code Namespaces
ucd: User Code Deployment
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
6 changes: 3 additions & 3 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ui:
static_files: [ netlify.toml ]
antora:
extensions:
- require: ./lib/api_json.js
- require: ./node_modules/hazelcast-docs-tools/antora-extensions/api-json.js
tags:
- Favorites
- Videos
Expand Down Expand Up @@ -294,6 +294,6 @@ asciidoc:
ucn: User Code Namespaces
ucd: User Code Deployment
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-mc-5.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/management-center-docs
branches: [v/5.0]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-mc-5.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/management-center-docs
branches: [v/5.1]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-mc-5.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/management-center-docs
branches: [v/5.2]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-mc-5.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/management-center-docs
branches: [v/5.3]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-mc-5.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/management-center-docs
branches: [v/5.4]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-mc-5.5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/management-center-docs
branches: [v/5.5]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-platform-5-0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/hz-docs
branches: [v/5.0]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-platform-5-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/hz-docs
branches: [v/5.1]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 4 additions & 4 deletions assembler-playbook-platform-5-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ site:
title: Documentation
url: https:/docs.hazelcast.com
content:
sources:
sources:
- url: https://github.com/hazelcast/hz-docs
branches: [v/5.2]
start_path: docs
antora:
extensions:
- '@antora/pdf-extension'
ui:
ui:
bundle:
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
snapshot: true
Expand All @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
4 changes: 2 additions & 2 deletions assembler-playbook-platform-5-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
4 changes: 2 additions & 2 deletions assembler-playbook-platform-5-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
4 changes: 2 additions & 2 deletions assembler-playbook-platform-5-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ asciidoc:
hazelcast-cloud: Cloud
page-cloud-console: https://cloud.hazelcast.com/
extensions:
- ./lib/tabs-block.js
- ./lib/swagger-ui-block-macro.js
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
- asciidoctor-kroki
8 changes: 0 additions & 8 deletions lib/antora-link-checker-extension.js

This file was deleted.

Loading

0 comments on commit 7ad74cd

Please sign in to comment.