oddbird / sassdoc-theme-herman

An Odd SassDoc theme.
http://oddbird.net/herman/
MIT License
117 stars 11 forks source link

Automatically publish documentation #385

Closed jerivas closed 1 year ago

jerivas commented 1 year ago

Description

Use GH Actions to automatically build and publish documentation on every release.

  1. On each stable release the publish-docs.yml workflow is called
  2. yarn build outputs to the docs/ folder
  3. The docs/ folder is pushed to the oddleventy-docs branch
  4. Netlify picks up the new commit on this branch and re-deploys the site at https://herman-docs.netlify.app/herman/docs
  5. oddbird.net proxies the Netlify site under the /herman/docs/ path (after we merge https://github.com/oddbird/oddleventy/pull/268)

I also added the option of running the workflow on demand. This should allow us to rebuild docs without having to create a release.

netlify[bot] commented 1 year ago

Deploy Preview for herman-staging ready!

Name Link
Latest commit 82fa18430774c65ac74ef8802c89262b42b7cc58
Latest deploy log https://app.netlify.com/sites/herman-staging/deploys/63641ab2d28675000c70c46c
Deploy Preview https://deploy-preview-385--herman-staging.netlify.app/changelog
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

jerivas commented 1 year ago

Now that I see it here, I wonder if we should just have a separate docs branch on this repo and have netlify publish that, instead of a separate repo and netlifly site 🤔

jgerigmeyer commented 1 year ago

Now that I see it here, I wonder if we should just have a separate docs branch on this repo and have netlify publish that, instead of a separate repo and netlifly site 🤔

Hm, good question. I can see how that would be cleaner, to not have extra repos. 🤔 I'm fine with whatever you prefer here -- this repo does already have one Netlify deployment (https://herman-staging.netlify.app/), but if it's easy to add a different deployment for a docs branch then I'm open to that.

jerivas commented 1 year ago

I think it depends on what we want to do. If it's useful to have git history for the built docs, then a separate repo makes sense. If not, then we can just have a separate branch that we only push to when new releases happen.

jgerigmeyer commented 1 year ago

I think it depends on what we want to do. If it's useful to have git history for the built docs, then a separate repo makes sense. If not, then we can just have a separate branch that we only push to when new releases happen.

Won't the branch provide a git history too?

jerivas commented 1 year ago

I was thinking that docs/ is ignored in this repo, but the branch can probably have its own .gitignore not related to main. I'll explore that

jerivas commented 1 year ago

I switched to using a new branch instead of a new repo in 9429e995194a2efa5922be9fe431198d024f9290. Everything else is pretty much the same. Keep in mind this oddleventy-docs branch will be empty until we run the workflow.

jerivas commented 1 year ago

It works if the other branch is not related to main, so it can have its own set of ignored files. I already pushed a branch like that for this repo

jgerigmeyer commented 1 year ago

Ah, I see -- so it just has no .gitignore file at all on that branch 👍

jerivas commented 1 year ago

Looks like I missed the inner docs folder, I'll open a new PR

jgerigmeyer commented 1 year ago

Oops, I just did: #387