Push remote content from an external source
Using remote content, you can use content from an external source in your Redocly project. Typically, users fetch content from a public URL, or integrate their Git repository with Redocly.
However in the situation where Redocly cannot be configured to access the remote content source, you can push content updates to your Redocly project when another content source changes.
Before you begin
Make sure you have the following before you begin:
- latest version of Realm
- an existing Redocly project to add remote content to
Add a remote to push content to
To set up a remote content folder for pushing:
- In the file tree, select the folder (or click on the empty space to select the root directory) to which you want to add the remote content folder.
- Select + > New remote folder > Add from CI/CD.
- Enter name for the new remote content folder and press Enter or Return key.
- Pick the platform that you will be pushing from to get the relevant fields displayed.
- Add a list of files to be included when pushing.
- Complete the other fields for the platform you are using.
- Copy the provided code snippet. For users of our GitHub application, a GitHub Actions workflow is provided; for other platforms or GitHub users not using the application, a CLI command is presented that you can run in your CI/CD process. In both cases, all the variables you need are pre-filled.
Get your API key
Authentication is required to push from another platform to Redocly, and this is done using an API key. To get the value and set it up for use in the CI/CD platform:
- Get your personal or organization API key by visiting your organization dashboard and selecting API keys from the Security section of the left hand menu.
- Add an environment variable named
REDOCLY_AUTHORIZATION
with the value of your API key to your CICD platform. - Use this variable with the command or workflow you copied in the previous step.
Push changes
To push changes to Redocly:
- Make a change to the remote content source.
- Check that the CI/CD steps you set up earlier in this guide ran as expected.
- Visit Redocly to review the new deploy.
Resources
- See guides for adding other types of remote content
- Learn more about remote content
- Configuration options for the GitHub action
- CLI push command information