Supported Frameworks
- React (Create React App, Vite)
- Vue (Vue CLI, Vite)
- Angular
- Svelte
- Next.js (static export)
- Any framework that produces static HTML/CSS/JS
Project Type Configuration
When creating a deployment, you must set
projectType: "static" for static sites.Required Configuration
Static sites require two mandatory fields:Build Command
The command to build your project. This is executed during the build phase. Common examples:Publish Directory
The directory where your build output is located. This directory is served by NGINX. Common examples:Deployment API Request
1
Prepare your deployment configuration
Create a deployment request with all required fields:
2
Send POST request to create deployment
3
Monitor build status
The build worker will:
- Clone your repository
- Run
npm cito install dependencies - Execute your build command
- Create a Docker image with NGINX
- Deploy the container
Environment Variables
Add environment variables for build-time configuration:Environment variables are written to a
.env file during the build process and are available during build time.Build Process Details
When you deploy a static site, DeployHub:- Clones your repository from the specified branch
- Installs dependencies using
npm ci - Creates
.envfile with your environment variables - Runs build command (or defaults to
npm run buildif not specified) - Builds Docker image using multi-stage build:
- Stage 1: Node.js 20 for building
- Stage 2: NGINX Alpine for serving
- Copies build output from
publishDirto/usr/share/nginx/html - Deploys container on port 80 with NGINX
Dockerfile Template
DeployHub uses this Dockerfile for static deployments:Framework-Specific Examples
Vite (React/Vue)
Create React App
Angular
Vue CLI
Validation Rules
DeployHub validates your configuration: From the validation schema:Updating Build Settings
You can update build settings after deployment:Troubleshooting
Build Fails
- Verify your
buildCommandis correct - Check that all dependencies are in
package.json - Ensure environment variables are properly set
Wrong Files Served
- Verify
publishDirmatches your build output directory - Check your framework’s build configuration
Environment Variables Not Working
- Ensure you’re using the correct prefix for your framework:
- Vite:
VITE_ - Create React App:
REACT_APP_ - Next.js:
NEXT_PUBLIC_
- Vite:
- Environment variables are only available at build time for static sites
Next Steps
Deploy Node.js Apps
Learn how to deploy backend applications
Monorepo Support
Deploy from specific folders in monorepos
Branch Management
Configure branch and commit tracking