Search code examples
githubgithub-pagesversioning

Github page version number syntax


I have a github repo that is also a github page. I use it as a CDN like so:

https://agentscript.org/src/Model.js

(agentscript.org is a CNAME forwarder to backspaces.github.io/agentscript/)

I would like to access the code by release number. So for example something like:

https://[email protected]/src/Model.js

Is there a way for me to do this? The above fails. Maybe a different syntax?

Note that npm publishing allows this to work on npm based CDNs like skypack or unpkg:

https://unpkg.com/[email protected]/src/Model.js https://cdn.skypack.dev/[email protected]/src/Model.js


Solution

  • GitHub Pages doesn't offer a feature like this. The reason is that GitHub Pages is designed to host a personal website or a site for your open source project, but isn't designed to be a CDN. The documentation outlines that there are limits, so if you need a CDN, you need to host your project on an actual CDN.