Add CD: deploy to dev on merge to main #29
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rbrooks/WeatherBot!29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/cd-dev-deploy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #12 (dev-only, SSH-to-dev rebuild — per the chosen approach).
What
.forgejo/workflows/cd.yml— on push tomain: run the test suite, then deploy to dev over SSH (git pull→APP_VERSION=$(git describe --tags) docker compose up -d --build app→ health check). The deploy jobneedsthe test job, so a red suite blocks deploy.DEV_SSH_KEYsecret; if unset it logs "skipping" and the run still passes. So merging this never reds-outmain, and deploys start automatically once you add the secret.ci.yml→ pull_request only — CD now covers push-to-main, so CI no longer double-runs there. The required check contextCI / test (pull_request)is unchanged.APP_VERSIONarg/env after the pip-install layer so version bumps don't invalidate the cached dependency layer (faster CD rebuilds).One-time setup you need to do (repo Settings → Actions)
DEV_SSH_KEY— a private SSH key whose public half is in the dev deploy user's~/.ssh/authorized_keys(the current flow usesclaude@10.1.1.14).DEV_HOST—user@hostoverride; defaults toclaude@10.1.1.14.Until the secret is added, every merge tests on CI and skips the deploy step.
Notes
Closes #12