Redocly/create-openapi-repo

Publishing to github

kalinchernev opened this issue ยท 8 comments

Hi,
First of all - thank you for making this project - it saved a lot of efforts and time for me!
I have a question about the part of publishing assets to github pages - is there is a specific reason the workflow goes around so many steps?
I personally had some issues with the automatic deployment via travis and simplified this as following:

  • Installed gh-pages instead of deploy-to-gh-pages
  • Added a task "gh-pages": "gh-pages -d dist", dist === web_deploy

This way, the user has the possibility to deploy manually, without setting a token or forcing a https remote variant.

I'm just sharing some thoughts that might be simpler to implement this part, but if there's a specific reason to have the feature in other way, please close the issue directly :)

Again thanks for your work on this project!

Having the same issue, and this worked for me.

Thanks for the work on this project! ๐ŸŽ‰

@kalinchernev or @rodrigojv ,
Can one of you explain, in detail, the steps for modifying the build and deployment process? I'm still a novice in this area, so I understand the concept of what "installed gh-pages instead of deploy-to-gh-pages" means, but I'm not sure exactly how I need to modify the package.json file or if/where "dist === web_deploy" needs to be specified.

Any further help is appreciated as I am running into similar problems with the deployment process as well.
Thanks!

@grodgersAtlas

  • install package gh-pages like this
  • add a gh-pages script like this

The reason you can use gh-pages cli directly like this comes from npm path magic. It's quite safe with node LTS or up.

Then you can have a script like this, it's just a combination of other scripts for super-lazy people like me.

mniak commented

In my case I needed to use gh-pages -d web_deploy. (Maybe I misunderstood something).
But then it worked very well after accepting the solution of our master @kalinchernev.

For someone has same issue to deploy on gh-pages. Following steps are work for me.

  1. add gh-pages module from npm npm install gh-pages
  2. add new line scripts in package.json "gh-pages": "gh-pages -d web_deploy"
  3. run npm run gh-pages
  4. trigger travis CI. It should be pass.
  5. Check repo's setting. Make sure gh-pages is use gh-pages branch
ets commented

fwiw - the defaults all worked for me (I didn't have to make any of the modifications described in the comments above) but I did have to manually create a gh-pages branch first. Before that the Travis build was failing when it attempted to clone that "gh-pages" branch that didn't yet exist.

Thanks @RomanGotsiy ! The above worked for me, adding a new branch called "gh-pages"
But the API documentation I see is not what my API specs have.I see the default echo and user APIs in docs? Anyone know why?

This is out of scope now.