Deployment & CI/CD Setup

A shared folder with AI prompts and code snippets

From workspace: Bolt

Team: Main

Total snippets: 7

Bolt

Deployment & CI/CD Setup

7 snippets

Create .env File for Secrets

Add an `.env` file for environment variables with instructions for local setup.

Create a `.env` file to store secrets and config variables. Include: – Add placeholder keys for API keys, DB URL, etc. – Load from `.env` in app – Ignore in Git using `.gitignore`

Add Build Command to package.json

Ensure the build script is correctly defined in `package.json`.

Add a build script to `package.json`. Include: – Command: `next build` or `vite build` depending on the framework – Ensure it runs without errors – Compatible with your deploy target

Add Linting to CI

Ensure lint checks run in CI and fail the build on error.

Update CI workflow to include lint step. Include: – Use `npm run lint` – Fail build if linting fails – Output errors in logs

Add GitHub Actions for CI

Set up GitHub Actions to lint, test, and build the app on every push.

Add GitHub Actions workflow for CI. Include: – Trigger on push to main – Run `npm install`, `npm run lint`, `npm run test`, `npm run build` – Use latest Node.js version

Add Vercel Deployment Script

Configure the project for Vercel deployment using a `vercel.json` file.

Configure this project for Vercel deployment. Include: – Add a `vercel.json` config file – Set default build command and output directory – Ignore test files during deploy

Add Deployment Status Badge

Add a deployment status badge to the README file.

Add a deployment status badge to the top of the README.md file. Include: – Use badge from GitHub Actions or Vercel – Link to live site – Make sure it updates on every commit

Optimize Static Assets for Deploy

Minify and optimize static assets before deployment.

Optimize static assets for production deployment. Include: – Compress images (JPEG, PNG) – Minify CSS and JS – Remove unused code or libraries

Bolt - Deployment & CI/CD Setup - AI Prompts & Code Snippets | Snippets AI