Skip to content

frain-dev/mintlify-preview-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mintlify Preview GitHub Action 🚀

This GitHub Action automates the process of deploying a Mintlify preview for documentation updates when a pull request is opened or updated. It posts a comment on the pull request with a link to the preview deployment.

Usage

To use this action, add the following workflow to your repository (.github/workflows/mintlify-preview.yml):

name: Mintlify Preview

on:
  pull_request:
    paths:
      - 'docs/**'  # Trigger only for changes in the docs directory
    types:
      - opened
      - synchronize

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Deploy Mintlify Preview
        uses: frain-dev/mintlify-preview-action@v0.1.3
        with:
          docs_path: "docs/mint.json"  # Path to your documentation file
          github_token: ${{ secrets.GITHUB_TOKEN }}

Inputs

The action accepts the following inputs:

Input Name Description Required Default Value
docs_path Path to the documentation file (e.g., docs/mint.json) Yes None
backend_url Custom backend server for deployment (optional) No https://mintlify-previewer.getconvoy.io/deploy
github_token GitHub token to comment on the PR Yes None

Outputs

The action provides the following output:

Output Name Description
deployment_url The URL of the Mintlify preview

Branding

  • Icon: upload-cloud
  • Color: blue

How It Works

  1. The action triggers on pull requests that modify files in the docs/ directory.
  2. It sends a request to the Mintlify previewer backend with the pull request details and documentation path.
  3. The backend generates a preview deployment and returns the deployment URL.
  4. The action posts a comment on the pull request with the preview URL.

Example

Here’s an example of the comment posted on the pull request:

🚀 Mintlify preview available at: https://01jnewdvfews9e74yvxftbp67c.mintlify-previewer.getconvoy.io

Powered by Convoy - send webhooks in minutes not months!

License

This project is licensed under the MIT License.


Made with ❤️ by frain-dev