Skip to content

Add Kamal configuration and GitHub Actions workflow for staging deploys - #7497

Merged
seanmarcia merged 5 commits into
mainfrom
add_kamal
Dec 4, 2026
Merged

seanmarcia merged 5 commits into
mainfrom
add_kamal

Conversation

@seanmarcia

@seanmarcia seanmarcia commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

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:

- 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>
Copilot AI balanced review requested due to automatic review settings 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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread config/deploy.staging.yml Resolved
seanmarcia and others added 3 commits December 3, 2026 20:53
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
seanmarcia merged commit 72ee381 into main Dec 4, 2026
13 checks passed
@seanmarcia
seanmarcia deleted the add_kamal branch December 4, 2026 03:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants