Missing assets: GitHub Pages not displaying properly
plbstl opened this issue · comments
This repo is deployed simultaneously to GitHub Pages and Netlify.
It displays correctly on Netlify. See https://6489cd17207ee90009819190--aip1.netlify.app/.
But deployments to GitHub Pages using actions (currently in beta) doesn't display correctly.
I have viewed the action logs and skimmed through the source code for actions/upload-pages-artifact, upload-artifact, and @actions/artifact. All seems well. I'm yet to look into actions/deploy-pages and the outputted URLs in the action logs.
Screenshots
Response headers
The response headers differ from other deployed pages projects. Here, I am comparing my main CSS file with base.css
from "square.github.io". Note that this can be a CSS file from any proper working deployed project.
- | plbstl.github.io/icon-previewer | square.github.io |
---|---|---|
access-control-allow-origin | ❌ | * |
age | 872 (higher than others) | 4 (sometimes as low as zero) |
cache-control | ❌ | max-age=600 |
content-security-policy | default-src 'none'; style-src 'unsafe-inline'; img-src data:; connect-src 'self' | ❌ |
content-type | text/html; charset=utf-8 (requested a CSS file!) | text/css; charset=utf-8 |
expires | ❌ | approximately 10 mins after Date header |
last-modified | ❌ | Datetime |
Conclusion
The assets are obviously not there, that's why GitHub sends a generic 404 HTML. Maybe they're in another location, who knows. I am not done debugging but that's taking some time. I'll switch to classic GitHub Pages on the main
branch with a /docs
folder. This is very okay for my current setup.
Edit: I really needed that sleep 🤦♂️
The problem is the link tag href attribute. It starts with an absolute path of /
instead of /icon-previewer/
.
As per http://username.github.io/repository
.
gh-pages with a specified branch uses actions under the hood 🤦♂️
using netlify for now
Yes it should. Thank you