|
4 | 4 | [](https://www.typescriptlang.org/) |
5 | 5 | [](https://ajv.js.org/) |
6 | 6 | [](https://ui.shadcn.com/) |
7 | | -[](https://github.com/FabienDostieIT/CSV_Data_Validator/actions/workflows/CI.yml) |
| 7 | +[](https://github.com/fabiendostie/CSV_Data_Validator/actions/workflows/CI.yml) |
8 | 8 |
|
9 | 9 | A modern, browser-based tool for validating, editing, and ensuring compliance of CSV data against predefined or custom JSON schemas. Built with Next.js, TypeScript, and Shadcn/ui. |
10 | 10 |
|
@@ -106,9 +106,61 @@ pnpm e2e |
106 | 106 |
|
107 | 107 | - **CI (`.github/workflows/CI.yml`):** Runs automatically on pushes/PRs to `main` and `develop`. Includes lint, format check, full tests (`pnpm test`), build, and E2E tests. |
108 | 108 | - **CodeQL (`.github/workflows/codeql-analysis.yml`):** Performs security analysis. |
109 | | -- **CD (`.github/workflows/CD.yml`):** Deploys the static export to GitHub Pages from the `main` branch. |
110 | | -- **Static Export:** Generated via `pnpm build && pnpm run export` (outputs to `./out`). |
111 | | -- **GitHub Pages:** Configure repo settings to serve from the `gh-pages` branch. |
| 109 | +- **Vercel Deployment (`.github/workflows/vercel.yml`):** Deploys the application to Vercel from the `main` branch using `BetaHuhn/deploy-to-vercel-action@v1`. |
| 110 | +- **Preview Deployments:** Automatically creates preview deployments for pull requests with PR comments showing deployment URLs. |
| 111 | +- **Vercel Configuration:** Uses `vercel.json` to define build settings and other configuration. |
| 112 | +- **2025 Compatibility:** All workflows are updated to use the latest GitHub Actions (v4+) and include the 2025-compatible cache keys that will remain functional after the April 2025 GitHub cache service changes. |
| 113 | + |
| 114 | +### Setting up Vercel Deployment |
| 115 | + |
| 116 | +To set up deployments to Vercel, you need to add the following secrets to your GitHub repository: |
| 117 | + |
| 118 | +1. `VERCEL_TOKEN`: Your Vercel API token |
| 119 | +2. `VERCEL_PROJECT_ID`: Your Vercel project ID |
| 120 | +3. `VERCEL_ORG_ID`: Your Vercel organization ID |
| 121 | +4. `GITHUB_TOKEN`: Automatically provided by GitHub Actions |
| 122 | + |
| 123 | +You can obtain the Vercel values from the Vercel dashboard or by running: |
| 124 | + |
| 125 | +```bash |
| 126 | +vercel link |
| 127 | +``` |
| 128 | + |
| 129 | +These secrets are required for both the production deployment workflow (`vercel.yml`) and the preview deployments in the CI workflow. |
| 130 | + |
| 131 | +### Testing GitHub Actions Locally |
| 132 | + |
| 133 | +This project includes tools to test GitHub Actions workflows locally before pushing changes to GitHub: |
| 134 | + |
| 135 | +1. Install [act](https://github.com/nektos/act) if you haven't already: |
| 136 | + |
| 137 | + ```bash |
| 138 | + # Linux/macOS with Homebrew |
| 139 | + brew install act |
| 140 | + |
| 141 | + # Or with npm |
| 142 | + npm install -g @nektos/act |
| 143 | + ``` |
| 144 | + |
| 145 | +2. Use the provided script to securely test workflows: |
| 146 | + |
| 147 | + ```bash |
| 148 | + # Source the script to load the function |
| 149 | + source act-secrets.sh |
| 150 | + |
| 151 | + # Test the Vercel deployment workflow |
| 152 | + run_act_workflow .github/workflows/vercel.yml push |
| 153 | + |
| 154 | + # Test the CI workflow with PR preview |
| 155 | + run_act_workflow .github/workflows/CI.yml pull_request |
| 156 | + ``` |
| 157 | + |
| 158 | +The script will prompt for your GitHub and Vercel credentials, which are never stored on disk and only kept in memory during the test. |
| 159 | + |
| 160 | +You'll need to create: |
| 161 | + |
| 162 | +- A [GitHub Personal Access Token](https://github.com/settings/tokens) with `repo` scope |
| 163 | +- Vercel credentials as mentioned in the deployment section |
112 | 164 |
|
113 | 165 | --- |
114 | 166 |
|
|
0 commit comments