shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
87 stars 18 forks source link

Port shotover docs/website to github actions #1851

Open rukai opened 2 days ago

rukai commented 2 days ago

hosting

We are moving the hosting from netlify to github pages.

Possibly we would want to host the docs and marketing parts of the websites on different github pages:

However I'm worried about complications due to needing to pay for hosting separately for these repos. So in this design I'm going to go ahead with hosting it all in this github pages, but there will be a separate repo with the website for two reasons:

To achieve this with one hosted repo, on every commit to shotover we will clone from the shotover-website repo, build it and deploy to the root of the github pages branch.

pages

Alter github actions release workflow to run mdbook and include the contents in latest and the current vx.y directory.

Downsides:

Implementation Chunking

  1. Add new workflow publish-main-to-pages.yaml to run on every merged PR to:
    • generate mdbook docs at the shotover repo github pages at /docs/main
    • the purpose of this is to allow us to preview the website before changes reach a release.
    • this also immediately gives us a way to view current docs before we even transfer the domain over.
  2. Alter release workflow to:
    • generate mdbook docs at the shotover repo github pages at /docs/latest
    • generate index.html linking to latest
  3. Add new stage to publish-main-to-pages.yaml to:
    • Clone the shotover website at a hardcoded commit and publish to /
    • This should be a minimum implementation at which point we could swap the website over to it.
  4. Add logic to release workflow to release to /docs/vx.y as well as latest.
    • Will need logic to convert current version string to one of the form v0.y/vx, completely clear current directory and write new docs.
rukai commented 1 day ago

Turns out I misremembered and github pages does not support a way to update portions of a deployed "github pages" while keeping the rest untouched. We can keep the same layout but will need to redeploy all versions every commit. This should be doable as regenerating a version should be pretty fast.

new chunking

  1. Add new workflow publish-website.yaml to run on every merged PR to:
    • generate mdbook docs at the shotover repo github pages at /docs/main
    • this immediately gives us a way to view current docs before we even transfer the domain over.
  2. Alter workflow to:
    • checkout latest tag (query for highest vx.y.z tag) and then generate mdbook docs at /docs/latest
    • generate index.html linking to latest
  3. Alter workflow to:
    • Clone the shotover website at a hardcoded commit and publish to /
    • This should be a minimum implementation at which point we could swap the website over to it.
  4. Alter workflow to:
    • Add logic to release workflow to release to /docs/vx.y as well as latest.
    • Will need logic to iterate over all vx.y.z tags and then find the highest version of each breaking release and deploy as v0.y/vx