|
| 1 | +# Vercel Deployment for Codegen Documentation |
| 2 | + |
| 3 | +This document explains how to set up Vercel deployments for the Codegen documentation site. |
| 4 | + |
| 5 | +## PR Deployments |
| 6 | + |
| 7 | +The repository is configured to automatically deploy PR previews to Vercel when changes are made to the `docs/` directory. |
| 8 | + |
| 9 | +### Setup Instructions |
| 10 | + |
| 11 | +To enable PR deployments to Vercel, follow these steps: |
| 12 | + |
| 13 | +1. **Create a Vercel Project**: |
| 14 | + - Go to [Vercel](https://vercel.com) and create a new project |
| 15 | + - Import the `codegen` repository |
| 16 | + - Configure the project with the following settings: |
| 17 | + - Framework Preset: Other |
| 18 | + - Build Command: `echo 'Mintlify docs deployment'` |
| 19 | + - Output Directory: `docs` |
| 20 | + |
| 21 | +2. **Configure GitHub Secrets**: |
| 22 | + - In the GitHub repository settings, add the following secrets: |
| 23 | + - `VERCEL_TOKEN`: Your Vercel API token (create one in Vercel account settings) |
| 24 | + - `VERCEL_ORG_ID`: Your Vercel organization ID (found in Vercel project settings) |
| 25 | + - `VERCEL_PROJECT_ID`: Your Vercel project ID (found in Vercel project settings) |
| 26 | + |
| 27 | +3. **Mintlify Integration**: |
| 28 | + - Ensure your Mintlify account is connected to the Vercel project |
| 29 | + - Mintlify will handle the actual documentation rendering |
| 30 | + |
| 31 | +## How It Works |
| 32 | + |
| 33 | +When a PR is opened or updated that includes changes to the `docs/` directory: |
| 34 | + |
| 35 | +1. The GitHub workflow `.github/workflows/vercel-pr-deployment.yml` is triggered |
| 36 | +2. The workflow deploys the documentation to Vercel |
| 37 | +3. A comment is added to the PR with a link to the preview deployment |
| 38 | +4. You can view the documentation preview to verify changes before merging |
| 39 | + |
| 40 | +## Production Deployment |
| 41 | + |
| 42 | +The production deployment is handled separately and is triggered when changes are merged to the main branch. |
| 43 | + |
| 44 | +## Troubleshooting |
| 45 | + |
| 46 | +If you encounter issues with the Vercel deployment: |
| 47 | + |
| 48 | +1. Check that all required secrets are properly configured |
| 49 | +2. Verify that the Vercel project settings match the configuration in `vercel.json` |
| 50 | +3. Ensure the Mintlify integration is properly set up |
| 51 | +4. Check the GitHub Actions logs for any error messages |
0 commit comments