Add CI/CD workflow with release versioning and GitOps frontend/backend deployments#5
Add CI/CD workflow with release versioning and GitOps frontend/backend deployments#5
Conversation
- Create .github/workflows/ci.yml with test, build, and Docker push jobs - Update backend deployment image to ghcr.io/jwraats/wizard-rpg-api:latest - Add frontend GitOps resources (deployment, service, nginx ConfigMap) - Update ingress to route through frontend (which proxies API calls to backend) - Update kustomization to include new frontend resources Agent-Logs-Url: https://github.com/jwraats/Wizard-RPG/sessions/0d412dbc-f7fc-45c8-ab7d-8b7beec9cf90 Co-authored-by: jwraats <3438726+jwraats@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jwraats/Wizard-RPG/sessions/0d412dbc-f7fc-45c8-ab7d-8b7beec9cf90 Co-authored-by: jwraats <3438726+jwraats@users.noreply.github.com>
| - name: wizard-rpg | ||
| # Update this image reference once the Docker image is built and pushed. | ||
| image: ghcr.io/jwraats/wizard-rpg:latest | ||
| image: ghcr.io/jwraats/wizard-rpg-api:latest |
There was a problem hiding this comment.
Would like to use version tags. (so on release)
There was a problem hiding this comment.
Updated in 9a64245. The workflow now triggers on release: [published] and tags Docker images with the release tag name (e.g., v1.0.0). The base deployment keeps :latest as the default, but the update-gitops job uses kustomize edit set image to add an images transformer to kustomization.yaml that overrides the tag with the release version.
| spec: | ||
| containers: | ||
| - name: wizard-rpg-frontend | ||
| image: ghcr.io/jwraats/wizard-rpg-frontend:latest |
There was a problem hiding this comment.
Same as backend — on release, the frontend image gets tagged with the version and kustomize overrides the tag via the images transformer in kustomization.yaml. See 9a64245.
| @@ -0,0 +1,114 @@ | |||
| name: CI/CD | |||
There was a problem hiding this comment.
Something with pushing the version tag to the gitops when the docker image is pushed maybe with kustomize?
There was a problem hiding this comment.
Added an update-gitops job in 9a64245. On release, after images are pushed, it checks out main, runs kustomize edit set image to set both image tags to the release version in kustomization.yaml, then commits and pushes. ArgoCD will pick up the change automatically.
|
@copilot Resolve the PR comments |
…x integration tests - CI workflow: add release trigger, version-tagged Docker images, update-gitops job - Fix integration tests: move Guid.NewGuid() outside AddDbContext lambda to share in-memory DB across requests (fixes 6/10 test failures) Agent-Logs-Url: https://github.com/jwraats/Wizard-RPG/sessions/b51228a4-19e9-4a19-a58c-90d8c8d0a944 Co-authored-by: jwraats <3438726+jwraats@users.noreply.github.com>
All three comments addressed in |
Adds a GitHub Actions pipeline to test, build, and push Docker images to GHCR, plus the missing frontend Kubernetes deployment. On release, Docker images are tagged with the release version and GitOps manifests are automatically updated via kustomize.
CI/CD Workflow (
.github/workflows/ci.yml)npm run build(vue-tsc type-check + vite build)ghcr.io:ghcr.io/jwraats/wizard-rpg-api(backend)ghcr.io/jwraats/wizard-rpg-frontend(frontend)latest+ git SHA on push to main; additionally tagged with the release version (e.g.,v1.0.0) on releasekustomize edit set imageto update both image tags inkustomization.yaml, and commits/pushes tomainso ArgoCD auto-syncs the new versionGitOps Updates
deployment.yaml: image →ghcr.io/jwraats/wizard-rpg-api:latest(overridden by kustomizeimagestransformer on release)frontend-deployment.yaml: nginx container with ConfigMap volume mount, health probes, resource limitsfrontend-service.yaml: ClusterIP on port 80frontend-nginx-configmap.yaml: nginx config that proxies/api/and/hubs/to thewizard-rpgbackend serviceingress.yaml: routes towizard-rpg-frontend(frontend proxies API traffic to backend)kustomization.yaml: includes new frontend resources;imagestransformer is auto-updated with version tags on releaseRequest flow
Integration test fix
Fixed 6 failing integration tests caused by
Guid.NewGuid()being evaluated inside theAddDbContextoptions lambda, which created a separate in-memory database per HTTP request. Moved the guid evaluation outside the lambda so all requests within a test share the same database.Validated with
kustomize build— all manifests render correctly with proper label isolation between frontend and backend selectors.