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

Add docs-build-push github workflow #2300

Closed

Conversation

nginx-jack
Copy link
Contributor

@nginx-jack nginx-jack commented Jul 29, 2024

Proposed changes

The NGINX docs site is migrating to self hosting. This PR adds support for a workflow to build, push, and provide PR previews. See: https://github.com/nginxinc/docs-actions

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork
NONE

@nginx-jack nginx-jack requested review from a team as code owners July 29, 2024 10:22
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.74%. Comparing base (9840a51) to head (b6513ef).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2300   +/-   ##
=======================================
  Coverage   87.74%   87.74%           
=======================================
  Files          96       96           
  Lines        6830     6830           
  Branches       50       50           
=======================================
  Hits         5993     5993           
  Misses        780      780           
  Partials       57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

site/README.md Outdated
@@ -2,7 +2,8 @@

This directory contains all of the user documentation for NGINX Gateway Fabric, as well as the requirements for building and publishing the documentation.

Documentation is written in Markdown, built using [Hugo](https://gohugo.io) with [nginx-hugo-theme](https://github.com/nginxinc/nginx-hugo-theme), then deployed with [Netlify](https://www.netlify.com/).
Documentation is written in Markdown, built using [Hugo](https://gohugo.io) with [nginx-hugo-theme](https://github.com/nginxinc/nginx-hugo-theme). Previews and deployments are handled by the [docs-actions](https://github.com/nginxinc/docs-actions?tab=readme-ov-file#docs-actions) workflow.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion only: I'd like us as a group to "take ownership:"

Suggested change
Documentation is written in Markdown, built using [Hugo](https://gohugo.io) with [nginx-hugo-theme](https://github.com/nginxinc/nginx-hugo-theme). Previews and deployments are handled by the [docs-actions](https://github.com/nginxinc/docs-actions?tab=readme-ov-file#docs-actions) workflow.
We write our documentation in Markdown. We build it with [Hugo](https://gohugo.io) and our custom [NGINX Hugo theme](https://github.com/nginxinc/nginx-hugo-theme). We set up previews and deployments using our [docs-actions](https://github.com/nginxinc/docs-actions?tab=readme-ov-file#docs-actions) workflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

OTOH, if you want to stay consistent with what you've set up in similar site/README.md files, I'm good with that too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes sense, I'll update the other PR I have up as well. 👍

branches:
- "*"
paths:
- "docs/**"
Copy link
Contributor

Choose a reason for hiding this comment

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

Our public docs live under the site/ directory. The docs/ directory is just developer docs in Github.

- prod
pull_request:
branches:
- "*"
Copy link
Contributor

Choose a reason for hiding this comment

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

Where will this publish to? Can we control which branches publish where?

For release branches (release-X.X), we want the docs published to prod. Every other branch should only publish previews, not prod.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When a PR is created that changes docs, a preview deploy will be made, and a URL will be added as a comment.
This does not deploy automatically, anywhere right now. You have to manually trigger the action, pick your branch, and pick your environment.
We're working on an update this week to allow users to specific a branch to autodeploy to an environment - I can hold off on this PR until that's ready if you like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh no that's fine, the preview on PRs is all that's needed. I think the only time that we want to actually publish is when docs are pushed to a release branch.

In netlify, we would first publish from the release branch after we pointed netlify at the branch (manual step that we did once the release was out), and then any docs changes in that branch going forward would be deployed automatically. I'm guessing that's the process you're referring to that you're working on?

Sidenote: it would be nice if we could have the doc preview exist in the actions list at the bottom of the PR instead of as a comment (just to save on the PR notifications and clutter in the comment section).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly what we're working on at the moment 😄 . We're trying to mimic your old workflow from Netlify.

I like the idea of adding the url to the bottom of the PR, would need some extra parsing logic, but doable for sure 👍 .

Copy link
Contributor

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

LGTM other than the linting errors that exist.

@nginx-jack
Copy link
Contributor Author

LGTM other than the linting errors that exist.

Great, will update tomorrow.

Problem: NGINX docs have migrated off netlify

Solution: This action will deploy to the new infrastructure, and
remove Netlify configuration from this project.
@nginx-jack nginx-jack force-pushed the feature/docs-build-and-deploy branch from 55fc522 to b6513ef Compare August 7, 2024 11:03
@sjberman
Copy link
Contributor

sjberman commented Aug 8, 2024

Closing in favor of #2351

@sjberman sjberman closed this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants