add metrics docs (#251) #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Convert AsciiDoc and Check Links | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
bundler-cache: true | |
- name: Install dependencies | |
run: | | |
gem install asciidoctor | |
gem install html-proofer | |
- name: Convert specified AsciiDoc files to HTML | |
run: | | |
mkdir -p converted_files | |
# List of AsciiDoc files to convert | |
mapfile -t files < published-adoc.txt | |
for file in "${files[@]}"; do | |
# Create the target directory if it doesn't exist | |
target_dir=converted_files/$(dirname "$file") | |
mkdir -p "$target_dir" | |
# Convert the AsciiDoc file and maintain directory structure | |
asciidoctor -o "$target_dir/$(basename ${file%.adoc}.html)" "$file" | |
done | |
cp -R images converted_files/ | |
- name: Check links in converted HTML files | |
#continue-on-error: true # Do not fail the job regardless of output | |
run: | | |
htmlproofer ./converted_files --disable-external |