Skip to content

Commit 6e5ddec

Browse files
fix: use build-sitemap
Signed-off-by: Victor Adossi <[email protected]>
1 parent b465716 commit 6e5ddec

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

.github/actions/mdbook/action.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ inputs:
3838
default: "0.7.7"
3939
description: |
4040
Version of mdbook-linkcheck to use (ex. '0.7.7')
41-
4241
env:
4342
ARTIFACT_PATH: ./component-model/book/html
4443

@@ -74,23 +73,10 @@ runs:
7473
with:
7574
python-version: '3.13'
7675

77-
- name: Ensure build outputs are present
78-
shell: bash
79-
run: |
80-
if [[ ! -f "${{ env.ARTIFACT_PATH }}/index.html" ]]; then
81-
echo "[error] index.html @ [${{ env.ARTIFACT_PATH }}] is missing. Build or path misconfigured";
82-
exit 1;
83-
fi
84-
8576
- name: Generate sitemap
8677
shell: bash
8778
run: |
88-
cd ${{ env.ARTIFACT_PATH }}
89-
python3 ../../../scripts/generate_sitemap.py \
90-
--domain "${{ inputs.publish-domain }}" \
91-
--higher-priority "design" \
92-
--output-path sitemap.xml
93-
cd ../../../
79+
just build-sitemap
9480
9581
- name: Ensure publish-domain was provided
9682
if: ${{ inputs.publish-pages-artifact }}

justfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ publish_domain := env_var_or_default("PUBLISH_DOMAIN", "component-model.bytecode
88

99
scripts_dir := env_var_or_default("SCRIPTS_DIR", "scripts")
1010

11-
sitemap_output_path := absolute_path("./component-model/book/html/sitemap.xml")
11+
sitemap_output_path := env_var_or_default("SITEMAP_OUTPUT_PATH", absolute_path("./component-model/book/html/sitemap.xml"))
12+
book_output_dir := env_var_or_default("BOOK_OUTPUT_DIR", "./component-model/book/html")
1213

1314
@_default:
1415
{{just}} --list
1516

1617
# Build the sitemap
1718
@build-sitemap:
18-
{{python}} {{scripts_dir}}/generate_sitemap.py --domain "{{publish_domain}}" --higher-priority "design" --output-path {{sitemap_output_path}}
19+
{{python}} {{scripts_dir}}/generate_sitemap.py --domain "{{publish_domain}}" --higher-priority "design" --output-path {{sitemap_output_path}}
20+
if [[ ! -f "{{book_output_dir}}/index.html" ]]; then \
21+
echo "[error] index.html @ [{{book_output_dir}}] is missing. Build or path misconfigured"; \
22+
exit 1; \
23+
fi
24+
1925

0 commit comments

Comments
 (0)