-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Swagger Docs on Github pages #28
Conversation
Needs to be tested first
Do you have an example of the auto-PR working? |
I'm trying to trigger one manually, one moment... |
|
@code1mountain status? Waiting for review? |
Yes, and also waiting for the other PR to be applied at the same time |
Just saw that it got merged, we can merge this PR now I think. Is there still confusion if we want the documentation files in this repo or a separate one? |
@cavallium what do you think? I vote for keep them in this repo |
@@ -0,0 +1,13 @@ | |||
name: Validate API swagger documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this to "Documentation" and rename the file to "docs.yml". The name of a step should be as broad as possible, the information on what is currently doing is contained in the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "dist" directory from this repository, also add it in .gitignore.
Generated files shouldn't be on the repository.
@MarcoBuster I think that it's ok to put documentation in this repository, but only the source of the documentation. |
@cavallium Sure, that's fair. |
We could also use GitHub actions and have all the generated/downloaded stuff in the gh-pages branch and host it with The downside with this is that everyone who wants to edit the documentation and verify that it is still valid needs some external software, but https://editor.swagger.io also does that. |
The nice thing with the GitHub pages action and the hosting in a separate branch is that every fork would have its own hosted documentation with all the changes made to it (if GitHub pages is enabled on the fork ofc). |
The docs will now be hosted in a separate gh-pages branch and will update on every push to the main branch.
Please review @cavallium @MarcoBuster |
@code1mountain The branch is not "main" but it's "master" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix branch name
Okay, now it's working on the master branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok for me, I'll wait @MarcoBuster to merge
What I dislike about a separate branch is finding the correct docs for am older version would be incredible difficult. Maybe we can make the automated commits at least contain the original commit hash so one has a chance to find it later? |
@luckydonald Ok |
Additionally, how would we handle pull requests with only a single branch? Would it automatically create a new How would the workflow for those branches look like? Because my thinking is the following: |
The separate branch mainly consists of a bunch of static html files and only the yaml file gets copied over there. If you want an older version of the docs, you can use the yaml file that sits in the master branch and view it with any swagger UI you want like https://editor.swagger.io. If we adapt to proper versioning in the future we will find a way to host the documentation for every release, but for now only the latest documentation is hosted. You can also copy the link to the raw openapi yaml file from a past version and enter it into the top bar of the documentation to view it. |
The workflow for branches overwrites the same branch |
Closes #14.
With this pull request we can create a swagger documentation on github pages. Should be applied together with #25 , because all the methods from this pull request are documented here.
It also has a github action to update swagger UI from time to time and send a pull request automatically. I had to modify it, but I think it works (had no chance to try it out).
The documentation can be viewed at https://code1mountain.github.io/tdlight-telegram-bot-api/. It will later be available at https://tdlight-team.github.io/tdlight-telegram-bot-api/.
Activating github pages for the first time takes a few minutes, after that every change should be ready after about a minute (because of the github cdn).