Skip to content

Commit f168ede

Browse files
author
InfoTech.io Bot
committed
fix(workflow): correct Hugo Templates Framework preserve-base-site integration
Hugo Templates Framework was failing on preserve-base-site strategy because it tried to wget https://info-tech-io.github.io but couldn't download due to rate limiting/server errors (exit code 8). The solution is to use the already downloaded current-site from Phase 1 as a local source module instead of making Hugo Templates Framework download it via wget. Key Changes: - Create temporary federation config for preserve-base-site strategy - Add current-site as local source module with destination '/' - Use download-merge-deploy strategy with local base site instead of preserve-base-site - Restructure current-site to match Hugo Templates Framework schema - Add cleanup for temporary configuration files Technical Implementation: - Create current-site/content/ subdirectory for proper schema compliance - Generate module.json for base site module - Use jq to create temporary config with local source - Maintain existing strategy selection logic This fixes the root cause: wget failure in preserve-base-site mode. Hugo Templates Framework now uses locally available content instead of attempting network downloads. Fixes: #10, Stage: 2 (Implementation) Resolves: wget exit code 8 error in federated-build.sh --preserve-base-site Tests: Local validation passed with mock current-site
1 parent 98261d6 commit f168ede

1 file changed

Lines changed: 54 additions & 3 deletions

File tree

.github/workflows/deploy-github-pages.yml

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,56 @@ jobs:
230230
STRATEGY="${{ steps.build-strategy.outputs.strategy }}"
231231
232232
if [ "$STRATEGY" = "preserve-base-site" ]; then
233-
echo "🔄 Incremental build - preserving existing content"
233+
echo "🔄 Incremental build - using existing current-site as base"
234+
235+
# КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ: Создать временную конфигурацию с current-site как local source
236+
echo "📄 Creating temporary federation config with local base site..."
237+
238+
# Создать правильную структуру для local source
239+
mkdir -p ../current-site/content
240+
# Переместить все файлы в content поддиректорию
241+
find ../current-site -maxdepth 1 -type f -exec mv {} ../current-site/content/ \;
242+
243+
# Создать минимальный module.json для current-site
244+
cat > ../current-site/module.json <<'EOF'
245+
{
246+
"module": {
247+
"name": "base-site",
248+
"version": "1.0.0",
249+
"description": "Current GitHub Pages content (downloaded)"
250+
},
251+
"build": {
252+
"template": "corporate",
253+
"theme": "compose",
254+
"copy_static": true
255+
}
256+
}
257+
EOF
258+
259+
# Создать модифицированную конфигурацию
260+
jq --arg current_site_path "$(pwd)/../current-site" '
261+
.federation.strategy = "download-merge-deploy" |
262+
.modules = [
263+
{
264+
"name": "base-site",
265+
"source": {
266+
"repository": "local",
267+
"local_path": $current_site_path,
268+
"path": "content",
269+
"branch": "main"
270+
},
271+
"module_json": "module.json",
272+
"destination": "/",
273+
"css_path_prefix": ""
274+
}
275+
] + .modules
276+
' ../hub-repo/configs/documentation-modules.json > ../temp-preserve-config.json
277+
278+
echo "✅ Temporary config created with current-site as base module"
279+
234280
./scripts/federated-build.sh \
235-
--config=../hub-repo/configs/documentation-modules.json \
281+
--config=../temp-preserve-config.json \
236282
--output=../docs-build \
237-
--preserve-base-site \
238283
--verbose \
239284
${{ github.event.inputs.debug == 'true' && '--debug' || '' }}
240285
else
@@ -246,6 +291,12 @@ jobs:
246291
${{ github.event.inputs.debug == 'true' && '--debug' || '' }}
247292
fi
248293
294+
# Cleanup temporary files
295+
if [ -f "../temp-preserve-config.json" ]; then
296+
rm -f ../temp-preserve-config.json
297+
echo "🧹 Cleaned up temporary config"
298+
fi
299+
249300
cd ..
250301
echo "✅ Federation build complete"
251302

0 commit comments

Comments
 (0)