Skip to content

Conversation

@TineoC
Copy link
Collaborator

@TineoC TineoC commented Feb 1, 2026

Fix deploy and CI: release-based image tagging, version-aware app, and prod stack.

CI & container publishing

  • containers-publish.yml: Triggers on GitHub Release (published) and on push to develop and main.
    • Releases: Image tag = release tag (e.g. v1.2.01.2.0).
    • main: Tag from merge commit message or latest git tag.
    • develop: Pre-release tag X.Y.Z-dev.<timestamp> (e.g. 1.2.0-dev.20260208120000).
  • VERSION is passed as a build-arg into the app image so the app can expose it.
  • deploy-downstream.yml removed (no longer used).

Version-aware app

  • Backend: New /api/v1/api/version endpoint (reads VERSION env, fallback "dev").
  • Frontend: Reusable Version component; Footer and About page show app version. API base cleanup (V1_API_BASE to avoid repeating /api/v1/api).

Docker & compose

  • Dockerfile.prod: Keeps ARG VERSION / ENV VERSION for the version endpoint.
  • docker-compose.prod.yml: Adds db service and shared network so the app can resolve SQL_HOST=db when running the prod stack locally.
  • docker-compose.yml / db/Dockerfile / frontend env: Config and cleanup as needed.

Other

  • frontend-ci.yml: Added for frontend CI (if applicable).

- Add trailing newline to frontend/.env.production (lint)
- Clarify apiClient baseURL comment for sandbox/production
- Add Frontend: Lint and Build workflow on develop
- Add docs/DEPLOY_RESOLUTION_STEPS.md for PR follow-up
- devbox.json: use kind-config.yaml (file exists as .yaml)
- deploy/manifests/balancer/overlays/kind: overlay with secretGenerator
  for balancer-config (SQLite) so kind runs without PostgreSQL
- deploy/kind-test.sh: create cluster, install ingress, build/load image,
  apply kind overlay, wait for deployment, curl API and verify status
…, manual deploy

- Deploy: Downstream: add permissions (contents, actions, pull-requests), add
  workflow_dispatch target (both|sandbox|live) for manual deploy; CD to
  sandbox on develop, live on release; manual run opens PRs to cluster repos
- Remove frontend/.env.production and VITE_API_BASE_URL from .env (relative URLs)
- SPA catch-all: always register, serve index.html at request time or 404
- Docs: README/CLAUDE/MIGRATION/DEPLOY_RESOLUTION_STEPS and PR body
@TineoC TineoC changed the title fix: deploy API and CI for sandbox + live (closes #450, #452) fix: deploy API and CI for sandbox + live Feb 1, 2026
@TineoC TineoC changed the title fix: deploy API and CI for sandbox + live feat: implement Flux image update automation for balancer Feb 7, 2026
@TineoC
Copy link
Collaborator Author

TineoC commented Feb 7, 2026

This PR depends on the following Pull Requests in the cfp-sandbox-cluster repository to fully enable the automation:

Please ensure those are merged and Flux is bootstrapped in the cluster before relying on this new workflow.

Copy link
Member

@themightychris themightychris left a comment

Choose a reason for hiding this comment

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

Please just open version bump PRs against the desired environment to deploy new versions

VERSION Outdated
@@ -0,0 +1 @@
1.2.0 No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

I recommend against tracking any version number in-tree, it creates a lot of annoying chicken-and-egg problems. A better approach is to trigger CI on GitHub release and put the version in the env from the release tag. You can pass in to docker builds via build args if you need the app to be self-aware of its version (e.g. to expose within the UI) and the official docker build action has feature for automatically pulling image tags from release versions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey i'm.sorry, this file was not supposed to be in the pr

@TineoC
Copy link
Collaborator Author

TineoC commented Feb 7, 2026

Please just open version bump PRs against the desired environment to deploy new versions

When I'm back home I would delete the Version file.

If I'm not wrong, the main branch release strategy is not affected by this changes. The only new steps are the dev tag structure so the sandbox cluster pulls the latest timestamp

@TineoC TineoC changed the title feat: implement Flux image update automation for balancer fix: deploy API and CI — release-based image tags, version endpoint, prod compose Feb 8, 2026
@TineoC
Copy link
Collaborator Author

TineoC commented Feb 8, 2026

@sahilds1 these changes are now ready to be merged into develop.

Once that merge is complete, the CI workflow will generate a new image tag (following the vX.Y.Z-dev.TIMESTAMP format). The next step will be to take that specific tag value and update the image reference in the sandbox cluster repo here:

https://github.com/CodeForPhilly/cfp-sandbox-cluster/blob/main/balancer/kustomization.yaml#L14

This will verify the new deployment logic in the sandbox environment.

DOCKER_TAG="${TAG#v}"
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
# Attempt to extract version from merge commit or branch if available
# release-prepare usually creates branch release/vX.Y.Z or commit "Release vX.Y.Z"
Copy link
Member

Choose a reason for hiding this comment

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

release-prepare does not create any branches, only opens a develop -> main PR or updates the changelog comment within it.

I would delete this logic branch for main and remove main from the trigger branches. main should never be getting pushed to outside the develop -> main release PR merges and those generate releases which will trigger runs of this action within the release event context. Unless the develop -> main workflow is being broken, the main push trigger and release trigger would only ever get triggered at the exact same time on the same commit

@sahilds1
Copy link
Collaborator

sahilds1 commented Feb 10, 2026

@sahilds1 these changes are now ready to be merged into develop.

@TineoC I'm going to leave it to @themightychris to LGTM this PR since he has requested changes to it

@themightychris
Copy link
Member

Please tag me when it's ready for another look

@TineoC
Copy link
Collaborator Author

TineoC commented Feb 10, 2026

@themightychris

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.

3 participants