Repository navigation
Add Kamal configuration and GitHub Actions workflow for staging deploys - #7497
Merged
Merged
Conversation
- Add kamal and thruster gems with bin/kamal and bin/thrust binstubs - Add Dockerfile.kamal and bin/docker-entrypoint (preserving existing Dockerfile for docker-compose/CI) - Configure Kamal for staging.casacarehub.org using GHCR and a Postgres 16 accessory - Add .github/workflows/deploy-staging.yml to deploy on pushes to main or manual dispatch - Add GET /up healthcheck route and exclude /up from SSL redirect for kamal-proxy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
seanmarcia
requested review from
FireLemons,
compwron and
elasticspoon
as code owners
December 4, 2026 01:46
- Resolve config/database.yml conflict while keeping connect_timeout: 5 from main - Lock thruster for the ruby platform alongside native platforms in Gemfile.lock - Update Dockerfile.kamal RUBY_VERSION to 4.0.10 and align deploy-staging.yml with ubuntu-24.04 and ruby/setup-ruby v1.343.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The entrypoint can attempt schema loading on an existing database after connection or boot failures, and the deployment lacks a worker to process background jobs.
1 open issue
What changed in this PR
Adds Kamal-based staging deployment for CASA while preserving the existing Docker workflow.
Changes:
- Adds a dedicated deployment image, Kamal configuration, and GitHub Actions workflow.
- Configures staging database access, persistent storage, and startup tasks.
- Adds a health endpoint and production settings for container deployment.
| File | Description |
|---|---|
| spec/requests/health_spec.rb | Tests the new health endpoint. |
| Gemfile.lock | Locks deployment dependencies. |
| Gemfile | Adds Kamal and Thruster. |
| Dockerfile.kamal | Defines the multi-stage deployment image. |
| config/routes.rb | Adds /up health route. |
| config/environments/production.rb | Adjusts storage, build, and health-check settings. |
| config/deploy.yml | Defines shared Kamal configuration. |
| config/deploy.staging.yml | Configures staging services and storage. |
| config/database.yml | Supports container database variables. |
| bin/thrust | Adds Thruster executable wrapper. |
| bin/kamal | Adds Kamal executable wrapper. |
| bin/docker-entrypoint | Prepares the database and deployment tasks. |
| .kamal/secrets.staging | Maps staging secrets from environment variables. |
| .kamal/secrets | Documents secret configuration. |
| .github/workflows/deploy-staging.yml | Automates staging setup and deployment. |
| .dockerignore | Excludes additional sensitive files. |
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add config/environments/staging.rb inheriting from production.rb with staging overrides for SECRET_KEY_BASE_DUMMY asset precompilation, local Active Storage, production credentials path, and /health SSL exclusion - Add staging sections to config/database.yml and config/cable.yml while restoring production sections to match main - Revert config/routes.rb and spec/requests/health_spec.rb and point Kamal proxy healthcheck to /health - Pass RAILS_ENV=staging build arg and runtime env in config/deploy.staging.yml and Dockerfile.kamal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
seanmarcia
added a commit
that referenced
this pull request
Dec 4, 2026
…ys (#7497) * Add Kamal configuration and GitHub Actions workflow for staging deploys - Add kamal and thruster gems with bin/kamal and bin/thrust binstubs - Add Dockerfile.kamal and bin/docker-entrypoint (preserving existing Dockerfile for docker-compose/CI) - Configure Kamal for staging.casacarehub.org using GHCR and a Postgres 16 accessory - Add .github/workflows/deploy-staging.yml to deploy on pushes to main or manual dispatch - Add GET /up healthcheck route and exclude /up from SSL redirect for kamal-proxy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Revert changes to config/environments/production.rb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add staging environment config and revert routes/production changes - Add config/environments/staging.rb inheriting from production.rb with staging overrides for SECRET_KEY_BASE_DUMMY asset precompilation, local Active Storage, production credentials path, and /health SSL exclusion - Add staging sections to config/database.yml and config/cable.yml while restoring production sections to match main - Revert config/routes.rb and spec/requests/health_spec.rb and point Kamal proxy healthcheck to /health - Pass RAILS_ENV=staging build arg and runtime env in config/deploy.staging.yml and Dockerfile.kamal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update deployment runner to Ubuntu 26.04 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

What github issue is this PR for, if any?
N/A — infrastructure change to enable Kamal deployments to staging
What changed, and why?
Adds Kamal 2 + Thruster deployment configuration, a dedicated Rails environment, and a GitHub Actions workflow so CASA can be deployed to staging without modifying existing production configuration or routes: