Versions
Build, deploy, and manage versions of your DYPAI application.
Overview
The Versions system allows you to:
- Build your application from source
- Create versioned releases
- Deploy to different environments
- Rollback to previous versions
- Download builds for self-hosting
Creating a Build
Navigate to Versions
Go to the Versions section in your project dashboard.
Click New Build
Click "New Build" to start the build process.
Select Branch
Choose the Git branch to build from (e.g., main, develop).
Configure Options
Set build options like environment and version tag.
Start Build
Click "Build" to start the compilation process.
Build Configuration
| Option | Description | Default |
|---|---|---|
| Branch | Git branch to build from | main |
| Environment | Target environment | production |
| Version Tag | Semantic version number | Auto-generated |
| Include Edge Functions | Bundle Edge Functions | true |
| Include Migrations | Include database migrations | true |
Build Status
| Status | Description |
|---|---|
| Pending | Build is queued |
| Building | Build in progress |
| Success | Build completed successfully |
| Failed | Build encountered errors |
| Cancelled | Build was cancelled |
Build Logs
View detailed build logs to understand the build process:
[2024-01-15 10:30:00] Starting build for branch: main
[2024-01-15 10:30:01] Fetching source code...
[2024-01-15 10:30:05] Installing dependencies...
[2024-01-15 10:30:30] Compiling Edge Functions...
[2024-01-15 10:30:45] - functions/hello.py: success
[2024-01-15 10:30:46] - functions/webhook.py: success
[2024-01-15 10:30:50] Running database migrations...
[2024-01-15 10:30:55] - 001_create_users.sql: applied
[2024-01-15 10:30:56] - 002_create_posts.sql: applied
[2024-01-15 10:31:00] Generating API documentation...
[2024-01-15 10:31:05] Creating build artifact...
[2024-01-15 10:31:10] Build completed successfully!
[2024-01-15 10:31:10] Version: v1.2.3
[2024-01-15 10:31:10] Artifact size: 15.2 MBClick on any log line to see more details and stack traces.
Deploying a Version
Deploy a successful build to your environment:
- Go to Versions and find the build
- Click "Deploy" on the desired build
- Select the target environment
- Confirm the deployment
// Deploy via API
const response = await fetch('https://your-project.dypai.io/api/v1/versions/v1.2.3/deploy', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + serviceRoleKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
environment: 'production'
})
});
const deployment = await response.json();
console.log('Deployed:', deployment.status);Rolling Back
Quickly revert to a previous version if issues arise:
- Go to Versions
- Find the previous stable version
- Click "Rollback to this version"
- Confirm the rollback
Rollbacks redeploy the previous version but don't undo database migrations.
Downloading Builds
Download builds for self-hosting or backup:
- Go to Versions
- Click the download icon on the desired build
- Choose the download format (ZIP or Docker image)
Download Formats
| Format | Contents | Use Case |
|---|---|---|
| ZIP | Source + compiled assets | Manual deployment |
| Docker | Container image | Container orchestration |
| Tarball | Compressed archive | Linux servers |
Build History
View all previous builds:
// Get build history via API
const response = await fetch('https://your-project.dypai.io/api/v1/versions', {
headers: {
'Authorization': 'Bearer ' + serviceRoleKey
}
});
const { versions } = await response.json();
versions.forEach(v => {
console.log(v.version, v.status, v.created_at);
});Environments
Manage multiple deployment environments:
| Environment | Purpose | URL Pattern |
|---|---|---|
| Production | Live application | your-project.dypai.io |
| Staging | Pre-production testing | staging.your-project.dypai.io |
| Development | Development testing | dev.your-project.dypai.io |
Build Webhooks
Configure webhooks to be notified of build events:
{
"event": "build.completed",
"version": "v1.2.3",
"status": "success",
"branch": "main",
"commit": "abc123",
"timestamp": "2024-01-15T10:31:10Z",
"artifact_url": "https://..."
}Best Practices
- Use semantic versioning (v1.2.3)
- Build from main/master for production
- Test in staging before production
- Keep a few previous versions for rollback
- Set up build notifications
- Review build logs for warnings