3

Dear fellow open sorcerers,

I want to host a site on GitHub pages that shows examples of a JavaScript library I'm working on. The examples should of course use the latest version of the library.

For index.html to be able to use the library, I need to ship something like mylib.dist.js, just as I would on any site.

My question is, is there a way of doing this without checking mylib.dist.js into the repository? Is it best practise to have gh-pages be completely different from master and contain all kinds of compiled output?

A solution would be something like start scripts, configured in some file, kinda like how Heroku's Procfile works. However, I haven't found any docs on such a feature on GitHub.

For others that are as (perhaps irrationally) reluctant as me to source control dist bundles, do you have good alternatives?

1 Answers1

4

Yes, you can do this by creating a release and attaching a binary to the release. Briefly, you do this by clicking the "Releases" link on the repository's main page and clicking the button to "Draft a new release". From there, look for the section to attach binaries to the release. (See the links in the first sentence for a detailed tutorial.)

Binaries are not part of your Git repository, but are stored separately by Github. Once you create the release, simply view it and copy the link to the binary you want to refer to.

apsillers
  • 35,995
  • 4
  • 94
  • 131