Allow gh-pages deployment to persist CNAME file #227
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Same CI changes as the TypeScript client: pinecone-io/pinecone-ts-client#144)
Problem
We've been looking at adding custom domains to our documentation references which are hosted via GitHub pages. When applying a custom domain, GitHub modifies the source branch and commits a CNAME file automatically.
See here: https://github.com/pinecone-io/pinecone-ts-client/blob/gh-pages/CNAME
If you're deploying to this branch as a part of CI, you need to handle maintaining the CNAME file. We're currently using the
git-publish-subdir-action
to achieve this: https://github.com/marketplace/actions/push-git-subdirectory-as-branch. This action blows away everything unless you specify specific files to persist.Solution
The action we're using supports passing a
CLEAR_GLOBS_FILE
argument allowing you to control what's replaced and what's persisted: https://github.com/marketplace/actions/push-git-subdirectory-as-branch#custom-clear-operations.clear-target-files
under.github/
. This file tells the action to clear everything but persist the CNAME file.merge.yml
to pass the file to the action in the merge workflow -> docs deployment step.Type of Change
Test Plan
Once this change is merged we can check the
gh-pages
branch to make sure the CNAME file is not blown away when we regenerate things and push togh-pages
.