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

Allow gh-pages deployment to persist CNAME file #144

Closed
wants to merge 1 commit into from

Conversation

austin-denoble
Copy link
Contributor

@austin-denoble austin-denoble commented Oct 20, 2023

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

  • Add .clear-target-files under .github/. This file tells the action to clear everything but persist the CNAME file.
  • Update merge.yml to pass the file to the action in the merge workflow -> docs deployment step.

Type of Change

  • Infrastructure change (CI configs, etc)

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 to gh-pages.

@@ -0,0 +1,2 @@
**/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured putting this under .github since it's specifically CI related was fine.

@austin-denoble austin-denoble changed the title Allow gh-pages deployment to persist CNAME files Allow gh-pages deployment to persist CNAME file Oct 20, 2023
@aulorbe aulorbe deleted the adenoble/docs-deploy-cname branch May 28, 2024 21:12
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.

1 participant