@@ -173,26 +173,32 @@ jobs:
173173 echo "✅ Pages setup completed successfully"
174174 echo "📄 Site will be deployed from ./build/site directory"
175175
176- # Verify PDF generation and copy to UI bundle expected location
177- - name : Verify PDF generation and copy to UI bundle expected location
176+ # Verify PDF generation and copy to correct location for download
177+ - name : Verify PDF generation and copy to correct location for download
178178 run : |
179179 if [ -f "./build/assembler/microprofile-tutorial/6.1/microprofile-tutorial.pdf" ]; then
180180 echo "✅ PDF generated in assembler location"
181181 PDF_SIZE=$(stat -f%z "./build/assembler/microprofile-tutorial/6.1/microprofile-tutorial.pdf" 2>/dev/null || stat -c%s "./build/assembler/microprofile-tutorial/6.1/microprofile-tutorial.pdf")
182182 echo "PDF Size: ${PDF_SIZE} bytes"
183183
184- # Copy PDF to location expected by UI bundle download link
184+ # Copy PDF to the exact location the download link expects
185+ # The download link is ../../microprofile-tutorial/6.1/microprofile-tutorial.pdf
186+ # From /microprofile-tutorial/6.1/index.html, this resolves to /microprofile-tutorial/6.1/microprofile-tutorial.pdf
185187 mkdir -p "./build/site/microprofile-tutorial/6.1/"
186188 cp "./build/assembler/microprofile-tutorial/6.1/microprofile-tutorial.pdf" \
187189 "./build/site/microprofile-tutorial/6.1/microprofile-tutorial.pdf"
188- echo "✅ PDF copied to UI bundle expected location"
189- ls -la ./build/site/microprofile-tutorial/6.1/microprofile-tutorial.pdf
190+ echo "✅ PDF copied to download location: /microprofile-tutorial/6.1/microprofile-tutorial.pdf"
190191
191- # Also copy assembler directory for backup access
192- cp -r ./build/assembler ./build/site/
193- echo "✅ Assembler directory copied for backup access"
192+ # Verify the copy was successful
193+ if [ -f "./build/site/microprofile-tutorial/6.1/microprofile-tutorial.pdf" ]; then
194+ echo "✅ PDF verification successful"
195+ ls -la ./build/site/microprofile-tutorial/6.1/microprofile-tutorial.pdf
196+ else
197+ echo "❌ PDF copy failed"
198+ exit 1
199+ fi
194200
195- # Create .htaccess for GitHub Pages to force PDF downloads
201+ # Create .htaccess for GitHub Pages to ensure proper PDF serving
196202 cat > ./build/site/.htaccess << 'EOF'
197203 # Set proper MIME type for PDF files
198204 <Files "*.pdf">
@@ -203,17 +209,17 @@ jobs:
203209 Header set Pragma "no-cache"
204210 Header set Expires "0"
205211 </Files>
206-
207- # Ensure PDF files are served correctly
208- RewriteEngine On
209- RewriteCond %{REQUEST_FILENAME} \.pdf$
210- RewriteRule ^(.*)$ $1 [L,T=application/pdf]
211212 EOF
212213
213- echo "✅ Download headers configured for PDFs"
214+ # Also create PDF-specific .htaccess in the PDF directory
215+ cp supplemental-ui/pdf-htaccess "./build/site/microprofile-tutorial/6.1/.htaccess"
216+ echo "✅ PDF-specific .htaccess created"
217+
218+ echo "✅ PDF download headers configured"
214219 else
215- echo "⚠️ PDF not found in assembler location"
220+ echo "❌ PDF not found in assembler location"
216221 find . -name "*.pdf" -type f
222+ exit 1
217223 fi
218224
219225 # Copy assembler directory to site for PDF access via UI bundle
0 commit comments