Running npm build using github actions and then deploying to github pages using my gh-pages branch. The index.html file loads fine from https://user.github.io/, but all other http requests go to that url instead of where the resource is, https://user.github.io/Project/
Here is one of the requests:
GET /static/css/main.15693543.css HTTP/2
Host: user.github.io
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0
Accept: text/css,/;q=0.1
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Connection: keep-alive
Referer: https:/user.github.io/Project/
Sec-Fetch-Dest: style
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
Priority: u=2
TE: trailers
*Note I replaced urls with user and Project
The file is there when I go to https://user.github.io/static/css/main.15693543.css. Just need to build where all file locations point to Project/static/~ and not /static/~
Here is the root html straight from the build:
Tried:
- adding npm run build –public-path=/Project/
- adding npm run build –base-url=/Project/
- enabling and disabling jekyll
- adding to header in html
- manually changing paths in each file of the branch which works, but thats not efficient
My temporary solution is a simple find and replace
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: “/static/”
replace: “/Project/static/”
regex: false
Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.