Promote and deploy
Keep the settings file in a git repository, validate it on pull requests, and promote it from development to staging to production.
The installation settings feature only needs a branch and a JSON file. This page describes the setup Lunnoa recommends: one repository, one long-lived branch per environment, and automation that validates changes and tells each install to reload.
Merging into a branch is the deployment. Each install reads its own branch, so a change reaches production only after it has been merged through the earlier environments.
Repository layout
The recommended layout keeps one file per section and generates the file the install reads.
sections/
workspaces.json the value of the "workspaces" key
roles.json the value of the "roles" key
ai.json the value of the "ai" key (providers, connections)
privacy.json the value of the "privacy" key
preview/ shapes for sections the server does not accept yet
settings/
lunnoa.settings.json generated file the install pulls
scripts/
assemble.mjs sections/*.json into settings/lunnoa.settings.json
validate.mjs JSON and environment-variable-name checks
.github/workflows/
validate.yml runs on pull requests
deploy.yml runs after a mergeEdit the files in sections/. Never edit settings/lunnoa.settings.json by hand.
Make a change
Branch from development
Create a short-lived branch from
dev, or push todevdirectly if your team allows it.Edit a section file
Change the file in
sections/. Check names and permissions against the file reference and permissions.Generate and check
Run the two scripts, then commit the section file and the generated file together.
bashnode scripts/assemble.mjs node scripts/validate.mjsOpen a pull request
Merge into
dev. Delete the short-lived branch after the merge.Promote
Open a pull request from
devintostaging, then fromstagingintoprod.
Branches
Three long-lived branches, one per environment. dev is the default branch.
dev to staging to prod| Branch | Install | How it changes |
|---|---|---|
dev | Development | Pull request from a short-lived branch, or a direct push |
staging | Staging | Pull request from dev only |
prod | Production | Pull request from staging only |
A pull request into staging from anywhere except dev fails. A pull request into prod from anywhere except staging fails. Do not skip staging.
Point each install at its own branch:
LUNNOA_SETTINGS_REPOSITORY=https://github.com/your-org/lunnoa-settings
LUNNOA_SETTINGS_BRANCH=staging
LUNNOA_SETTINGS_PATH=settings/lunnoa.settings.jsonWhat the automation does
| Workflow | When | What it does |
|---|---|---|
| Validate settings | On a pull request into dev, staging, or prod | Checks the promotion order, regenerates the file and fails if it differs from the committed one, then runs the schema check |
| Deploy settings | After a push to dev, staging, or prod | Repeats the checks, then asks that one install to reload |
The deploy step calls POST /api/admin/installation-settings/reload on the install. It never sends the settings content. The install pulls the file from its branch itself.
Secrets on each GitHub environment
Create a GitHub environment for each branch (dev, staging, prod) and set:
| Secret | Example |
|---|---|
LUNNOA_URL | https://dev.your-deployment.example |
LUNNOA_RELOAD_TOKEN | Bearer token for a SuperAdmin |
A workspace API key (lna_...) cannot reload. If either secret is missing, the deploy step skips the reload with a warning. The settings still apply the next time that install restarts.
Provider keys with env
If a provider uses { "source": "env", "name": "OPENAI_API_KEY" }, add a GitHub secret with that exact name to the same environment. The deploy step posts every such secret to the install's secrets endpoint first and then asks it to reload. It uses a machine user token for the push. To rotate a key, change the GitHub secret and run the deploy again. Providers that use serverEnv, vault, or manual need nothing here. See Secrets and API keys.
Before you promote
| Check | Why it matters |
|---|---|
Every serverEnv variable is set on the target install | A missing variable fails the whole reload |
Every env secret exists in the GitHub environment | Without a pushed value the reload fails |
Every vault path exists on the target Vault, and the Lunnoa role can read it | A wrong path only shows up when a model call needs the key |
| Every model id exists on the target install | Catalogue seeding can differ between installs |
| No same-name rows were created in Admin Space on the target | A clash fails the reload |
| Privacy changes are called out in the pull request | failMode and entity lists change what reaches the model |