Last updated

Add remote files from GitHub

If your content is stored in a repository on GitHub, you can connect that repository, so you can access and publish those files in Redocly.

To connect a GitHub repo:

  1. Install the Redocly app in GitHub.
  2. Create a new branch in Redocly.
  3. Enter the connection details in Redocly.
  4. Merge the open pull request in Redocly.

Install the Redocly app in GitHub

Before you enter the connection details in Redocly, you need to install the Redocly GitHub App on your organization in GitHub.

  1. Navigate to Install Redocly, and select the organization on GitHub.
  2. Enter your GitHub password to confirm access.
  3. Grant the Redocly GitHub App access to your project's repository.

See Installing a GitHub App from a third party in the GitHub documentation for more information.

Create a new branch in Redocly

Before you make any changes to your project, you should create a new branch. This new branch is a place where you can make changes without affecting the published site until you are ready. After you have iterated on your changes based on reviews by your team and the updates have been approved, you can merge your changes into the published site.

To create a new branch:

  1. Go to the project editor.

  2. Click the name of the current branch.

    Screenshot where current branch is on project page

  3. Enter the name for your new branch and select Create Branch.

Enter the connection details in Redocly

After you install the Redocly GitHub App on your organization in GitHub, and create a new branch, you need to enter the connection details in Redocly.

  1. In the file tree, select the folder (or click on the empty space to select the root directory) where you want to add the remote content folder.
  2. Select + > New remote folder > Add Git repository.
  3. Enter a name for the new remote content folder and press Enter or Return key.
  4. Select GitHub > Next.
  5. Authorize your Redocly organization to verify your GitHub identity.
  6. Select your GitHub Organization > Repository > Branch.
  7. (Optional) Select the Folder, if you want to include only a specific folder from the repository.
  8. Select the Auto-sync or Auto-merge toggles to turn off either option.
  9. Enter a name for the destination of the remote content in the Mount folder path text box.
  10. Select Add remote. This action opens a pull request in Redocly automatically. After refreshing your browser, you should see a View Pull Request button next to your new branch name.

Merge the open pull request in Redocly

After you enter the connection details in Redocly, a pull request to merge your updates with the default branch opens.

  1. Refresh your browser to see a View Pull Request button next to your new branch name.
  2. Select View Pull Request.
  3. Review your updates in the Review tab.
  4. After the tests have run and your pull request has been approved, click the Merge button to merge your updates with the default branch.