Sorry to necro this thread but since the link to my old repo is now gone since I archived the repo. Here’s an updated guide for those who stumbled across this.
I have a script (main.py) that I used to generate a plain HTML containing a Plotly graph that can be viewed from my Github Pages site (https://pokgak.xyz/citf-graphs/).
-
Enable Github Pages. Here’s an example of my setting for the example:
-
Create your plot as usual and at the end import it to HTML using the
write_htmlfunction. Snippet from my script: citf-graphs/main.py at 1080a51151ba0029ba611ba9d3cb59e77809513a · pokgak/citf-graphs · GitHub
Since the file is just plain HTML, Github Pages will pick it up. Bonus if you name your file index.html and put it at the configured root directory of your Github Pages setting like I did in my example repo. Then, Github will automatically shows it when you go to the Github Pages URL of that repository. In my case, this is pokgak.github.io/citf-graphs.
Example file structure of my repo:
If you name your file other than that, then you’ll need to also specify the file name to access from Github Pages e.g. output file example.html can be accessed using URL pokgak.github.io/citf-graphs/example.html (link example only, not working).
Hope that clears up any confusion.

