feat: Kamal production deployment with CI/CD#199
Merged
zainfathoni merged 15 commits intomainfrom Jan 10, 2026
Merged
Conversation
- Add docs/decisions/001-kamal-deployment.md documenting the decision to use Kamal instead of PM2+nginx for production deployment - Remove docs/vps-deployment.md (superseded by Kamal approach) Key decision drivers: - Multi-app hosting support for future applications - Built-in HA capability with multiple servers - Docker-based consistency between environments - Zero-downtime deployments via Traefik
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Create production-ready Dockerfile with: - Build stage: node:24-alpine, npm ci, Prisma generate, Remix build - Production stage: pruned deps, non-root user, OpenSSL for Prisma - Explicit remix-serve path for CJS compatibility with Node 24 Update .dockerignore with comprehensive exclusions for faster builds.
- Create config/deploy.yml with server, registry, proxy, and env setup - Add .kamal/secrets.example documenting required secrets - Add .kamal/secrets to .gitignore
- Remove duplicate ghcr.io from image path - Use absolute path for DATABASE_URL (file:/app/prisma/prod.db) - Change 'multiarch: false' to 'arch: amd64' for Kamal 2.0
- Add backup-db.sh for daily SQLite backups with 30-day retention - Add restore-db.sh for safe database restoration - Add download-backup.sh to fetch backups to local machine - Add backup-setup.md documentation - Add prisma/backups/ to .gitignore Closes rb-4ca.7 Amp-Thread-ID: https://ampcode.com/threads/T-019ba70f-5528-749c-bab6-85ffe771776f Co-authored-by: Amp <amp@ampcode.com>
- Add playwright.docker.config.ts for testing deployed containers - Add npm scripts: test:e2e:docker, test:e2e:production - Add e2e/smoke.spec.ts for public pages (no auth required) - Support DOCKER_URL/BASE_URL env vars for flexible target URLs - Update docs with E2E testing instructions Tested against production: 6/6 smoke tests pass Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019ba71d-6242-72af-920f-7986c36e6c86
0a77469 to
a0d64ea
Compare
- Disable Vercel deployments (deploymentEnabled: false) - Create .github/workflows/deploy.yml with full test suite - Deploy only after lint, type-check, unit-test, e2e-test pass - Add Docker layer caching (type=gha) for faster builds - Document required GitHub Secrets in docs/deployment.md Closes rb-s6j Amp-Thread-ID: https://ampcode.com/threads/T-019ba734-5d2d-76f9-af80-0cef9b28f467 Co-authored-by: Amp <amp@ampcode.com>
- Split secrets into Repository (shared) and Environment (per-env) - Add environment: production to deploy job - Use dummy values for E2E test secrets (not needed for testing)
Deploy workflow now triggers after CI workflow passes on main, instead of duplicating all test jobs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes rb-4ca
Summary
Complete production deployment infrastructure using Kamal 2.0 with automated CI/CD pipeline.
Production Environment
Key Changes
Deployment Infrastructure
Dockerfile- Multi-stage build for Remix app with Prismaconfig/deploy.yml- Kamal 2.0 configuration.kamal/secrets.example- Template for local secretsCI/CD Pipeline
.github/workflows/ci.yml- Renamed from test.yml for consistency.github/workflows/deploy.yml- Auto-deploy after CI passes on mainworkflow_runtrigger (no duplicate test jobs)Documentation
docs/deployment.md- Deployment guide with secrets setupdocs/backup-setup.md- Database backup configurationdocs/decisions/001-kamal-deployment.md- ADRVercel Disabled
vercel.json- SetdeploymentEnabled: falseGitHub Secrets Required
Repository secrets:
Production environment secrets:
Test Plan