How to provide online access to source documentation upon release. #200322
-
🏷️ Discussion TypeQuestion BodyAs I see it, the release of a code library contains at least the following files:
What I would like is for the repository to contain a link to the generated documentation from the latest release. Preferably in the side menu when viewing the repo. One method would be for me to publish that documentation on some external web site. Then I suppose that I could provide a link to that index in the README.md file. I know that "pages" exist and would provide the desired link, but it seems to me that may have the following issues:
I apologize if something like this has already been asked. The few questions that my search turned up cause me more confision that help. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
If I understand correctly, you're looking for a way to make the latest generated HTML documentation available from your repository without cluttering the main branch with generated files or forcing users to download them. GitHub Pages is actually intended for this use case. You don't need to commit the generated documentation to your main branch. Instead, you can publish it to a dedicated This also addresses your concern about replacing documentation files on every release—the deployment simply publishes the newly generated documentation, so there's no need to manually manage those files in your main branch. As for the HTML rendering, the reason your Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
|
Okay, yes you seem to understand my needs and concerns correctly. |
Beta Was this translation helpful? Give feedback.
-
|
Exactly, GitHub Pages has two publishing methods:
Since you're new to GitHub, I'd actually recommend starting with the first option because it's easier to understand. Once you're comfortable with GitHub Actions, you can automate the entire process. And yes, you can absolutely make this part of your release process. For example, when you create a new release (or push a version tag), a GitHub Actions workflow can:
That way, every release automatically updates the documentation website, and your main branch stays free of generated files. |
Beta Was this translation helpful? Give feedback.
-
|
The best practice is not to commit generated HTML documentation into your main source branch. Instead, use GitHub Pages with an automated workflow:
This avoids all of the concerns you listed:
If you want documentation tied to each release, another common approach is:
Overall, the typical setup is: This is the approach used by many open-source projects because it keeps the repository clean while still providing browsable, versioned documentation. |
Beta Was this translation helpful? Give feedback.
Exactly, GitHub Pages has two publishing methods:
Since you're new to GitHub, I'd actually recommend starting with the first option because it's easier to understand. Once you're comfortable with GitHub Actions, you can automate the entire process.
And yes, you can absolutely make this part of your release process. For examp…