Skip to content
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

Automatically publish documentation #385

Merged
merged 6 commits into from
Nov 3, 2022
Merged

Automatically publish documentation #385

merged 6 commits into from
Nov 3, 2022

Conversation

jerivas
Copy link
Member

@jerivas jerivas commented Nov 2, 2022

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 Use Netlify redirects to host docs oddleventy#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
Copy link

netlify bot commented Nov 2, 2022

Deploy Preview for herman-staging ready!

Name Link
🔨 Latest commit 82fa184
🔍 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 jerivas requested a review from jgerigmeyer November 2, 2022 18:56
@jerivas
Copy link
Member Author

jerivas commented Nov 2, 2022

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
Copy link
Member

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
Copy link
Member Author

jerivas commented Nov 2, 2022

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
Copy link
Member

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
Copy link
Member Author

jerivas commented Nov 2, 2022

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
Copy link
Member Author

jerivas commented Nov 2, 2022

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

Copy link
Member

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work without modifications to the .gitignore file, which ignores docs/?

@jerivas
Copy link
Member Author

jerivas commented Nov 3, 2022

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
Copy link
Member

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

* main:
  Fix node v14 test
  Switch from circleci/codecov/appveyor to gh-actions.
@jgerigmeyer jgerigmeyer merged commit fd1588e into main Nov 3, 2022
@jgerigmeyer jgerigmeyer deleted the auto-docs branch November 3, 2022 19:54
@jerivas
Copy link
Member Author

jerivas commented Nov 3, 2022

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

@jgerigmeyer
Copy link
Member

Oops, I just did: #387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants