#!/bin/bash echo "๐Ÿงช Testing local deployment simulation..." # Create test directories mkdir -p test-output/main mkdir -p test-output/ghost-content echo "๐Ÿ“ Simulating dual-output build..." # Test 1: Check if ghost profile exists if grep -q "ghost:" _quarto.yml; then echo "โœ… Ghost profile configuration found" else echo "โŒ Ghost profile not found" exit 1 fi # Test 2: Simulate content extraction echo "๐Ÿ” Testing content extraction logic..." cd ghost-upload # Test with sample URL (without actually hitting network) echo "๐Ÿ“ Testing Rust compilation and basic logic..." if cargo check --quiet; then echo "โœ… Rust code compiles successfully" else echo "โŒ Rust compilation failed" exit 1 fi cd .. # Test 3: Check if CI would work echo "๐Ÿ”ง Validating CI configuration..." if ./validate-ghost-extraction.sh > /dev/null 2>&1; then echo "โœ… CI validation passed" else echo "โŒ CI validation failed" exit 1 fi echo "" echo "๐ŸŽ‰ Local testing complete!" echo "" echo "๐Ÿ“‹ What happens in CI:" echo " 1. Builds main site โ†’ public/" echo " 2. Builds ghost content โ†’ public/ghost-content/" echo " 3. Rust extracts from ghost-content URLs" echo " 4. Posts to Ghost blog with clean HTML" echo "" echo "๐Ÿš€ Ready for branch testing in GitLab CI!" echo " โ€ข Download artifacts to see both outputs" echo " โ€ข Use manual trigger to test force-update" echo " โ€ข Check ghost-content/ folder structure"