You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Web service that publishes a preview of a GitHub project documentation.
The documentation itself has to be built during the project continuousintegration and published as a GitHub actions artifact.
Client installation
To be able to use this service in your project, you need to have a CIjob that looks like this:
on:[ push, pull_request ]jobs:doc:name:Build Documentationruns-on:ubuntu-lateststeps:# Instead of this step you may have a step to check out the repository,# another to call `sphinx-build`, or anything that generates a directory# with the html version of your website or documentation -run:mkdir docs_dir && echo "Preview is working!" > docs_dir/index.html -uses:actions/upload-artifact@v4with:name:docs_artifactpath:docs_dir
Then, you can add one action in your CI to for example publish the website ordocumentation of a pull request when a user writes a comment with the content/preview:
on:issue_comment:types:createdjobs:previewer:runs-on:ubuntu-latestpermissions:pull-requests:writeif:github.event.issue.pull_request && github.event.comment.body == '/preview'steps: -uses:pandas-dev/github-doc-previewer@masterwith:# The server specified here has to explicitly allow your GitHub organizationpreviewer-server:"https://pandas.pydata.org"# Note that this has to match with the name of the job where the# `upload-artifact` action is calledartifact-job:"Build Documentation"
Server Installation
Currently only packages for Debian are provided. The package can be installedusing the next command:
All the fields are optional except for the GitHub token, which is required.
Logging
When a problem exists, the service will in general report it to the client.Checking the logs of thegithub-doc-previewer action run that failed mayprovide information on the cause of the problem. Errors will also be loggedin the server, and can be checked using the standard journal logs:
journalctl -u doc-previewer.service
About
Service to preview documentation from GitHub artifacts