@@ -40,79 +40,39 @@ jobs:
4040 VITE_SUPABASE_ANON_KEY : ${{ secrets.VITE_SUPABASE_ANON_KEY }}
4141 # Disable public registration for production
4242 VITE_ENABLE_PUBLIC_REGISTRATION : ' false'
43- # Set base path for GitHub Pages (root for TradingGoose.github.io)
44- PUBLIC_URL : /
4543 # Set to production to enable console stripping
4644 NODE_ENV : production
4745 run : npm run build
4846
4947 - name : Copy index.html to 404.html for SPA routing
5048 run : cp ./dist/index.html ./dist/404.html
5149
52- - name : Add .nojekyll file
53- run : touch ./dist/.nojekyll
54-
55- - name : Fix GitHub Pages compatibility and create _headers
50+ - name : Prepare for GitHub Pages
5651 run : |
57- cd ./dist
58-
59- # Create proper Netlify-style _headers file for GitHub Pages compatibility
60- cat > _headers << 'EOF'
61- /*
62- X-Frame-Options: DENY
63- X-Content-Type-Options: nosniff
64- Referrer-Policy: strict-origin-when-cross-origin
65-
66- /*.js
67- Content-Type: text/javascript; charset=utf-8
68- Cache-Control: public, max-age=31536000, immutable
69-
70- /*.mjs
71- Content-Type: text/javascript; charset=utf-8
72- Cache-Control: public, max-age=31536000, immutable
52+ # Add .nojekyll to prevent Jekyll processing
53+ touch ./dist/.nojekyll
7354
74- /assets/*.js
75- Content-Type: text/javascript; charset=utf-8
76- Cache-Control: public, max-age=31536000, immutable
55+ # Add CNAME file if using custom domain (comment out if not needed)
56+ # echo "yourdomain.com" > ./dist/CNAME
7757
78- /*.css
79- Content-Type: text/css; charset=utf-8
80- Cache-Control: public, max-age=31536000, immutable
58+ # Verify the build output
59+ echo "=== Build Output Structure ==="
60+ ls -la ./dist/
8161
82- /assets/*.css
83- Content-Type: text/css; charset=utf-8
84- Cache-Control: public, max-age=31536000, immutable
85-
86- /favicon.ico
87- Content-Type: image/x-icon
88- Cache-Control: public, max-age=86400
89- EOF
90-
91- # Verify files exist
92- echo "=== Checking build output ==="
93- ls -la ./
94- echo ""
95- echo "=== Assets directory ==="
96- ls -la assets/ || echo "No assets directory found"
9762 echo ""
63+ echo "=== JavaScript Files ==="
64+ find ./dist -name "*.js" -type f | head -10
9865
99- # Find all JavaScript files
100- find . -name "*.js" -type f | while read file; do
101- echo "✓ Found JS file: $file ($(file -b --mime-type "$file"))"
102- done
103-
104- # Verify favicon
105- if [ ! -f "favicon.ico" ]; then
106- echo "ERROR: favicon.ico not found"
107- exit 1
66+ echo ""
67+ echo "=== Checking index.html ==="
68+ if [ -f "./dist/index.html" ]; then
69+ echo "✓ index.html found"
70+ # Show script tags to debug MIME type issues
71+ grep -E '<script|<link' ./dist/index.html | head -5
10872 else
109- echo "✓ favicon.ico found ($(file -b --mime-type favicon.ico))"
73+ echo "ERROR: index.html not found!"
74+ exit 1
11075 fi
111-
112- # Check HTML references
113- echo ""
114- echo "=== Module script references in HTML ==="
115- grep 'type="module"' index.html || echo "No module scripts found"
11676
11777 - name : Setup Pages
11878 uses : actions/configure-pages@v4
0 commit comments