forked from skupperproject/skupper-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.25 KB
/
asciidoc-convert-check.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
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