Skip to content

ci: build to GHCR and deploy to do-prod#11

Merged
tompscanlan merged 2 commits into
mainfrom
ci/ghcr-do-prod
Jul 17, 2026
Merged

ci: build to GHCR and deploy to do-prod#11
tompscanlan merged 2 commits into
mainfrom
ci/ghcr-do-prod

Conversation

@tompscanlan

Copy link
Copy Markdown
Contributor

What

Retargets CI from ECR → EKS-dev to GHCR → do-prod (the only live cluster after the AWS→DO migration), mirroring the openmeet-api rewire:

  • build-and-deploy: drops the AWS/ECR login; logs in to ghcr.io and builds + pushes ghcr.io/openmeet-team/survey:<sha> (+:latest) with the job's built-in GITHUB_TOKEN (permissions: packages: write). Preserves the plain docker build (no build args). The do-prod overlay's two survey images[] entries share one newName, so both update in a single yq pass.
  • update-image-gitops (reusable): pins the tag by setting the do-prod images[].newTag via yq 'select(.newName == …)' — with a guard that fails the run if no entry matches (no silent no-op deploys). Targets environment: do-prod.

PR test jobs are unchanged and still run on PRs; only the push-to-main build/deploy path changed.

Depends on

The infra refactor that makes the do-prod images: transformer the single source of truth (openmeet-infrastructure #11, merged). No further infra change is needed — the do-prod overlay already maps this service to ghcr.io/openmeet-team/survey, so the tag bump rolls the Deployment (and its CronJobs) in one shot.

Requires before merge

The survey GHCR package must grant this repo Actions: Write (Package settings → Manage Actions access) or the GITHUB_TOKEN push will 403. Swapping to a PAT is a 2-line change (noted inline in the workflow).

On merge

Builds a fresh image and deploys it to do-prod via ArgoCD auto-sync. This commit only changes workflow files, so the resulting image is behavior-identical to what's live today — a low-risk first exercise of the full pipeline.

Watch: kubectl -n prod rollout status deployment/survey

Post AWS->DO migration, main builds and pushes the image to
ghcr.io/openmeet-team/survey using the job's built-in GITHUB_TOKEN (no ECR /
AWS credentials), and the gitops step pins it into the do-prod overlay
instead of the retired dev environment.

- build-and-deploy: log in to ghcr.io, build + push :<sha> and :latest,
  request packages: write.
- update-image-gitops (reusable): set the do-prod images[].newTag for the
  service, matched on newName so multi-entry services update in one shot,
  with a guard that fails the run if no entry matches. Targets do-prod.
The `test` job installed `templ@latest`; the CLI has drifted ahead of the
pinned runtime (github.com/a-h/templ v0.3.960), so `templ generate` emitted
code referencing symbols the runtime lacks (templ.ResolveAttributeValue),
failing the build. Pin the CLI to v0.3.960 to match go.mod (regeneration
produces zero diff; `go build ./...` passes). Unblocks CI.
@tompscanlan
tompscanlan merged commit 3c09d71 into main Jul 17, 2026
3 checks passed
tompscanlan added a commit that referenced this pull request Jul 17, 2026
The builder stage ran `go install .../templ@latest`. `@latest` now resolves to
v0.3.1020, which requires Go >= 1.25, but the builder is golang:1.24-alpine
(GOTOOLCHAIN=local) — so the prod image build fails at `templ generate`.

Pin the CLI to v0.3.960 to match go.mod's runtime (requires Go 1.23; builds on
the 1.24 builder). Regeneration produces zero diff and `go build ./...` passes.
The CI test job was already pinned in #11; this aligns the Dockerfile.
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.

1 participant