diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e336fb0..e1e3651 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,23 @@ deploy: paths: - public +# Branch preview deployment (for testing) +preview: + stage: deploy + script: + - echo "Deploying branch preview..." + - echo "Preview available at: ${CI_ENVIRONMENT_URL}" + needs: + - deploy + artifacts: + paths: + - public + environment: + name: preview/$CI_COMMIT_REF_SLUG + url: https://${CI_PROJECT_PATH_SLUG}-${CI_COMMIT_REF_SLUG}.gitlab.io + rules: + - if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH" + # GitLab Pages deployment (only on main branch) pages: stage: deploy diff --git a/test-local-deployment.sh b/test-local-deployment.sh new file mode 100755 index 0000000..80b4a1c --- /dev/null +++ b/test-local-deployment.sh @@ -0,0 +1,55 @@ +#!/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" \ No newline at end of file