Deploying Gituhb Pages to Cloudflare subdirectory
I currently have my frontend-mentor challenges at https://github.com/jhilker98/frontend-mentor-challenges. I'd like to be able to deploy it to my site at something like
mysite.com/frontend-mentor-challenges
. Can I do that on Cloudflare? I'm currently using Astro and I have the base
set to /frontend-mentor-challenges
.4 Replies
You can put a
CNAME
file in the root of your repo on the branch set to publish your GitHub Pages with something like fmc.mysite.com
in it then your info will be accessible at that hostname.
You'll also have to add a subdomain CNAME record from fmc
to jhilker98.github.io
in your DNS.
So far as having it appear in a subdirectory, that's trickier.GitHub
GitHub - tschaub/gh-pages: General purpose task for publishing file...
General purpose task for publishing files to a gh-pages branch on GitHub - GitHub - tschaub/gh-pages: General purpose task for publishing files to a gh-pages branch on GitHub
thanks, i had a cname
If you could host the root of your site in GitHub, having a CNAME for
mysite.com
in the <username>.github.io
repository will give you access to mysite.com/frontend-mentor-challenges/
.
I poked a bit a Cloudflare & I'm pretty sure you can only mask one directory within your tree as another. You can't mask another server.
You can set up a HTTP redirect for a URL easily enough which will change the URL in the address bar.
Or, you could display the GitHub Pages in an <iframe>
on the page in question.oh alright, thanks!