ci: deploy :latest with rollout restart, single replica
CI and Deploy / Build site (push) Successful in 20s
CI and Deploy / Build and push image (push) Successful in 16s
CI and Deploy / Deploy to Kubernetes (push) Successful in 12s

Drop the sha-pinned overlay and automatic rollback. The deployment now
runs 1 replica with imagePullPolicy Always, and CI restarts it after
apply so the new :latest image is pulled.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jesse Egbosionu
2026-10-24 22:02:08 +02:00
co-authored by Claude Opus 5.5
parent bab237834b
commit 5365bcdf82
4 changed files with 14 additions and 28 deletions
+5 -6
View File
@@ -8,9 +8,9 @@ https://jesseinit.dev (`www.` redirects to the apex). TLS comes from cert-manage
`.github/workflows/deploy.yml` (run by Gitea Actions) on every push to `master`:
1. **Build site**: `npm ci && npm run build`, and renders the kustomization to catch manifest errors.
2. **Build and push image**: `tea.jesseinit.dev/jesseinit/personal-site:sha-<commit>` and `:latest`.
3. **Deploy**: pins `newTag` in `kustomization.yaml` to `sha-<commit>`, runs `kubectl apply -k k8s/`,
waits for the rollout, and rolls back automatically if it fails.
2. **Build and push image**: `tea.jesseinit.dev/jesseinit/personal-site:latest`.
3. **Deploy**: runs `kubectl apply -k k8s/`, then `kubectl rollout restart` so the pod pulls the new
`:latest` (`imagePullPolicy: Always`), and waits for the rollout. There is no automatic rollback.
Pull requests run step 1 only. Old images are cleaned up by the nightly `gitea-package-prune` cronjob.
@@ -24,7 +24,7 @@ Pull requests run step 1 only. Old images are cleaned up by the nightly `gitea-p
## Files
- `namespace.yaml`: `personal-site` namespace
- `deployment.yaml`: 2 replicas, zero-downtime rolling updates, non-root, health checks
- `deployment.yaml`: 1 replica, zero-downtime rolling updates, non-root, health checks
- `service.yaml`: ClusterIP on port 80 → container port 3000
- `ingress.yaml`: nginx ingress + TLS for `jesseinit.dev` / `www.jesseinit.dev`
- `configmap.yaml`: optional environment variables
@@ -35,8 +35,7 @@ Pull requests run step 1 only. Old images are cleaned up by the nightly `gitea-p
```bash
kubectl --context personal-cluster -n personal-site get pods,ingress,certificate
kubectl --context personal-cluster -n personal-site logs -l app=jesseinit-portfolio -f
kubectl --context personal-cluster -n personal-site rollout undo deployment/jesseinit-portfolio
# Deploy by hand (uses :latest)
kubectl --context personal-cluster apply -k k8s/
kubectl --context personal-cluster -n personal-site rollout restart deployment/jesseinit-portfolio
```