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

[Docs] Update merge workflow to push generated artifacts to sdk-docs repo #146

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

austin-denoble
Copy link
Contributor

Problem

The current flow for building and deploying documentation for SDK clients takes place within each repository. Currently, merge workflows handle the docs build step, and pushing the contents of the generated /docs folder to a specific branch for each client: gh-pages. This branch is then used as the deployment source for GitHub pages.

There are several issues intrinsic in this:

  • We have to manage each CI configuration and deployment on a per-repo basis.
  • Applying custom sub-domains to our GitHub pages instances is difficult, and we would need to define a specific sub-domain for each repo.
  • We're unable to share resources or assets across docs pages without duplicating things in each repo.

Solution

Instead of having the CI workflows push documentation artifacts to a local branch, we can instead centralize our SDK documentation in a specific repo and allow workflows to commit docs updates directly to this repo. This allows us to deploy all our SDK documentation via one GitHub pages configuration. This also allows us to centralize all of our generated documentation, which could be useful in the future where we may move to a centralized docs-hosting solution that all the SDK repos need to feed into.

The changes in this PR are relatively small, and there was some pre-setup outside these changes:

Pre-Setup

  • Create new pinecone-io/sdk-docs private repo to house generated documentation artifacts.
  • Add SSH deploy keys to sdk-docs and source repos (pinecone-ts-client, pinecone-python-client) to allow writing to the sdk-docs repo. Documentation on this step. It's recommended to use SSH deploy keys over a GitHub PAT token.
  • SSH secrets within client repos are titled SSH_DEPLOY_KEY.

This PR

  • Update merge workflow to use the github-action-push-to-another-repository action. Action documentation

Type of Change

  • Infrastructure change (CI configs, etc)

Test Plan

I should have all the prerequisites set up to allow our CI workflow to push directly to sdk-docs. For this change we can merge and verify that the resulting /docs folder was correctly pushed to sdk-docs/typescript.

user-email: clients@pinecone.io
target-branch: main
target-directory: typescript
commit-message: 'TypeScript: automated documentation build'
Copy link
Collaborator

Choose a reason for hiding this comment

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

A git SHA or something in this title might be nice so we can correlate the changes later, if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, will get that added.

@jhamon
Copy link
Collaborator

jhamon commented Oct 23, 2023

Seems fine to land with failing integration tests. This is unrelated.

@austin-denoble austin-denoble merged commit a4bb2d9 into main Oct 23, 2023
19 checks passed
@austin-denoble austin-denoble deleted the adenoble/merge-workflow-push-to-repo branch October 23, 2023 21:19
austin-denoble added a commit to pinecone-io/pinecone-python-client that referenced this pull request Oct 23, 2023
…repo (#228)

## Problem
(These are basically the same changes as the TypeScript client, PR info
is the same: pinecone-io/pinecone-ts-client#146)

The current flow for building and deploying documentation for SDK
clients takes place within each repository. Currently, `merge` workflows
handle the docs build step, and pushing the contents of the generated
`/docs` folder to a specific branch for each client: `gh-pages`. This
branch is then used as the deployment source for GitHub pages.

There are several issues intrinsic in this:
- We have to manage each CI configuration and deployment on a per-repo
basis.
- Applying custom sub-domains to our GitHub pages instances is
difficult, and we would need to define a specific sub-domain for each
repo.
- We're unable to share resources or assets across docs pages without
duplicating things in each repo.

## Solution
Instead of having the CI workflows push documentation artifacts to a
local branch, we can instead centralize our SDK documentation in a
specific repo and allow workflows to commit docs updates directly to
this repo. This allows us to deploy all our SDK documentation via one
GitHub pages configuration. This also allows us to centralize all of our
generated documentation, which could be useful in the future where we
may move to a centralized docs-hosting solution that all the SDK repos
need to feed into.

The changes in this PR are relatively small, and there was some
pre-setup outside these changes:

### Pre-Setup
- Create new `pinecone-io/sdk-docs` private repo to house generated
documentation artifacts.
- Add SSH deploy keys to `sdk-docs` and source repos
(`pinecone-ts-client`, `pinecone-python-client`) to allow writing to the
`sdk-docs` repo.
[Documentation](https://cpina.github.io/push-to-another-repository-docs/setup-using-ssh-deploy-keys.html#setup-ssh-deploy-keys)
on this step. It's recommended to use SSH deploy keys over a GitHub PAT
token.
- SSH secrets within client repos are titled `SSH_DEPLOY_KEY`.

### This PR 
- Update `merge` workflow to use the
`github-action-push-to-another-repository` action. [Action
documentation](https://cpina.github.io/push-to-another-repository-docs/overview.html)

## Type of Change
- [X] Infrastructure change (CI configs, etc)

## Test Plan
I should have all the prerequisites set up to allow our CI workflow to
push directly to `sdk-docs`. For this change we can merge and verify
that the resulting `/docs` folder was correctly pushed to
`sdk-docs/typescript`.

I tested the structure of the repo and publishing via GitHub pages in a
personal repo:
https://github.com/austin-denoble/test-docs
- Python - https://austin-denoble.github.io/test-docs/python
- Typescript - https://austin-denoble.github.io/test-docs/typescript
austin-denoble added a commit that referenced this pull request Oct 31, 2023
## Problem
An issue was filed calling out the broken **Reference Documentation**
link in the `README.md` file:
#149

We recently updated our domain for hosting client reference docs:
#146

## Solution

Update the link to the new location and match previous routing:
https://sdk.pinecone.io/typescript/classes/Pinecone.html

## Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [X] Non-code change (docs, etc)

## Test Plan
Check that the **Reference Documentation** link in `README.md` navigates
to the correct page.
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