This repository was archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Add an RFD for a Mintlify migration workflow #444
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
authors: Paul Gottschling ([email protected]), Walt Della ([email protected]) | ||
state: draft | ||
--- | ||
|
||
# RFD 1 - Mintlify migration workflow | ||
|
||
We are moving the docs over to the hosted platform | ||
[Mintlify](https://mintlify.com/), and want to update both our Mintlify-managed | ||
site and our [current docs site](https://goteleport.com/docs/) with every | ||
documentation PR we merge to gravitational/teleport. This document outlines a | ||
high-level plan for managing the dual deployment. | ||
|
||
## How Mintlify works | ||
|
||
Mintlify is a SaaS platform that hosts customer documentation sites. | ||
|
||
Mintlify detects pushes to a GitHub repo configured by a user and | ||
updates the user's docs site based on Markdown source files within the | ||
repo (either at the root of the repository or at a user-specified | ||
directory). | ||
|
||
Users can configure Mintlify to detect changes to a branch within a | ||
repository. The "Set up as monorepo" option limits reads to a specific | ||
directory: | ||
|
||
 | ||
|
||
## How the migration script works | ||
|
||
The migration script is in the gravitational/docs repo (see [the | ||
PR](https://github.com/gravitational/docs/pull/437)). This repo includes a | ||
[submodule](https://github.com/gravitational/docs/tree/main/content) for each | ||
supported version of gravitational/teleport, which are currently master, | ||
branch/v15, branch/v14, and branch/v13. The migration script builds | ||
Mintlify-compatible source files based on these submodules and places the output | ||
in a directory in the gravitational/docs repo. | ||
|
||
## Automating the migration script on "gravitational/teleport" merges | ||
|
||
This strategy uses a GitHub Actions workflow in `gravitational/teleport` that | ||
calls a child workflow in `gravitational/docs` when a docs PR is merged. The | ||
child workflow runs the migration script and pushes to a protected branch in | ||
`gravitational/docs`. We would then configure Mintlify to watch the migration | ||
output directory in this protected branch. | ||
|
||
This allows a single place to track deploys, and parallels the current | ||
Vercel strategy. | ||
|
||
### GitHub Actions workflow in `gravitational/docs` | ||
|
||
This strategy uses an action in the `docs` repo with two triggers: | ||
|
||
- `workflow_call` (to receive incoming deploys from `teleport`) | ||
|
||
- push to main, which already has branch protections, to trigger a rebuild on | ||
changes to the migration script. | ||
|
||
- Has a dedicated GitHub application that is the only user allowed to write to | ||
a certain branch (say, `mintlify`) of `gravitational/docs`. | ||
|
||
The workflow runs the migration script and, using | ||
`actions/create-github-app-token`, assumes the identity of the dedicated GitHub | ||
application. This application will push to a dedicated branch in the `docs` repo | ||
that only the action is allowed to write to, using the following branch | ||
protection rule: | ||
|
||
 | ||
|
||
### GitHub Actions workflow `gravitational/teleport` | ||
|
||
**Trigger**: pushes to `master` in `docs/pages` | ||
|
||
Uses a GitHub app to trigger the workflow in `gravitational/docs` (see the | ||
[GitHub | ||
docs](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow)). | ||
Authenticates as the GitHub app using `actions/create-github-app-token@v1` to | ||
call the action in `gravitational/docs` mentioned above. | ||
|
||
The app id and private key would live in the locked down `update-docs` | ||
environment, which can only be triggered by `teleport`s `master` and | ||
`branch/v\*` branches. |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a section here about the Mintlify Github app, and how it should be configured.
Particularly, the Mintlify GitHub App will need to be installed on the teleport org, but we want to make sure:
docs