|
| 1 | +name: Deploy Static Site |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + deploy: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + # Explicitly override any Jekyll environment variables |
| 14 | + env: |
| 15 | + JEKYLL_ENV: "" |
| 16 | + GITHUB_PAGES: "" |
| 17 | + JEKYLL: "" |
| 18 | + BUNDLE_GEMFILE: "" |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v3 |
| 23 | + |
| 24 | + - name: Force Static Site Mode |
| 25 | + run: | |
| 26 | + echo "🚫 FORCING STATIC SITE MODE - NO JEKYLL ALLOWED" |
| 27 | + |
| 28 | + # Clear all Jekyll-related environment variables |
| 29 | + unset JEKYLL_ENV |
| 30 | + unset GITHUB_PAGES |
| 31 | + unset JEKYLL |
| 32 | + unset BUNDLE_GEMFILE |
| 33 | + |
| 34 | + # Create explicit static site markers |
| 35 | + echo "STATIC_SITE=true" > .static-site |
| 36 | + echo "NO_JEKYLL=true" >> .static-site |
| 37 | + echo "BUILD_TYPE=static" >> .static-site |
| 38 | + |
| 39 | + # Remove any Jekyll-related files if they exist |
| 40 | + rm -f Gemfile Gemfile.lock _config.yml |
| 41 | + |
| 42 | + # Ensure .nojekyll exists |
| 43 | + touch .nojekyll |
| 44 | + |
| 45 | + echo "✅ Static site mode enforced" |
| 46 | + |
| 47 | + - name: Validate Static Files |
| 48 | + run: | |
| 49 | + echo "🔍 Validating static site files..." |
| 50 | + |
| 51 | + # Check for required files |
| 52 | + required_files=("index.html" "styles.css" "script.js") |
| 53 | + for file in "${required_files[@]}"; do |
| 54 | + if [ -f "$file" ]; then |
| 55 | + echo "✅ $file found" |
| 56 | + else |
| 57 | + echo "❌ $file missing" |
| 58 | + exit 1 |
| 59 | + fi |
| 60 | + done |
| 61 | + |
| 62 | + # Verify no Jekyll files |
| 63 | + jekyll_files=("Gemfile" "_config.yml" "_posts" "_layouts" "_includes") |
| 64 | + for file in "${jekyll_files[@]}"; do |
| 65 | + if [ -f "$file" ] || [ -d "$file" ]; then |
| 66 | + echo "❌ Jekyll file/directory found: $file" |
| 67 | + exit 1 |
| 68 | + fi |
| 69 | + done |
| 70 | + |
| 71 | + echo "✅ All static site validations passed" |
| 72 | + |
| 73 | + - name: Test Site |
| 74 | + run: | |
| 75 | + echo "🚀 Testing static site..." |
| 76 | + |
| 77 | + # Simple HTML validation |
| 78 | + if grep -q "<!DOCTYPE html>" index.html; then |
| 79 | + echo "✅ DOCTYPE found" |
| 80 | + else |
| 81 | + echo "❌ DOCTYPE missing" |
| 82 | + exit 1 |
| 83 | + fi |
| 84 | + |
| 85 | + if grep -q "<html" index.html; then |
| 86 | + echo "✅ HTML tag found" |
| 87 | + else |
| 88 | + echo "❌ HTML tag missing" |
| 89 | + exit 1 |
| 90 | + fi |
| 91 | + |
| 92 | + echo "✅ Static site validation completed" |
| 93 | + |
| 94 | + - name: Prepare for Deployment |
| 95 | + run: | |
| 96 | + echo "📦 Preparing static site for deployment..." |
| 97 | + |
| 98 | + # Create deployment manifest |
| 99 | + cat > deployment-info.txt << EOF |
| 100 | + STATIC SITE DEPLOYMENT |
| 101 | + ====================== |
| 102 | + Site Type: Pure HTML/CSS/JavaScript |
| 103 | + Build Required: NO |
| 104 | + Jekyll Required: NO |
| 105 | + Ruby Required: NO |
| 106 | + |
| 107 | + Files: |
| 108 | + - index.html (main page) |
| 109 | + - styles.css (styling) |
| 110 | + - script.js (interactivity) |
| 111 | + - .nojekyll (prevents Jekyll processing) |
| 112 | + |
| 113 | + Deployment URL: https://telcosec.github.io/Telecom-Security-Documents |
| 114 | + EOF |
| 115 | + |
| 116 | + echo "✅ Deployment preparation completed" |
| 117 | + |
| 118 | + - name: Success Message |
| 119 | + run: | |
| 120 | + echo "" |
| 121 | + echo "🎉 STATIC SITE READY FOR DEPLOYMENT!" |
| 122 | + echo "=====================================" |
| 123 | + echo "" |
| 124 | + echo "📱 Your site will be available at:" |
| 125 | + echo " https://telcosec.github.io/Telecom-Security-Documents" |
| 126 | + echo "" |
| 127 | + echo "📋 To deploy:" |
| 128 | + echo "1. Go to repository Settings > Pages" |
| 129 | + echo "2. Select 'Deploy from a branch'" |
| 130 | + echo "3. Choose 'main' branch and '/(root)' folder" |
| 131 | + echo "4. Click 'Save'" |
| 132 | + echo "5. Wait 5-10 minutes" |
| 133 | + echo "" |
| 134 | + echo "✨ This is a pure static site - no build process needed!" |
| 135 | + echo "🚫 Jekyll has been completely disabled" |
0 commit comments