You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 706a198
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: fold the dev and prod deploys into one workflow
deploy-dev.yml and deploy-prod.yml were the same five jobs with a handful of
per-environment names between them, which is how prod's health check kept a
comment saying DNS did not point at it yet. deploy.yml derives the target from
the trigger and reduces the difference to three guard outputs: the ECR tag, the
version alias, and the stack list.
Both TF_VAR role arns now pass unconditionally — each is set on one Environment
only and the other resolves to "", which the stacks already read as off. Dev
picks up prod's stronger health check, over the ALB by name rather than DNS.
Previews stay separate: they share the ECR promote and nothing else.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .github/workflows/README.md
+53-42Lines changed: 53 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ Automated CI/CD for Block Explorer. Dev, prod and previews all run on ECS Fargat
8
8
PR merged to main
9
9
→ codebase-versioning.yml tags v.X.Y.Z (increment:* label picks the bump)
10
10
→ publish-ghcr-image.yml builds the multi-arch image, or aliases one it already has
11
-
→ deploy-dev.yml promotes it to ECR and deploys dev
11
+
→ deploy.yml promotes it to ECR and deploys dev
12
12
→ prepare-release.yml leaves exactly one draft release
13
13
14
14
Draft published
15
-
→ deploy-prod.yml deploys prod
15
+
→ deploy.yml deploys prod
16
16
```
17
17
18
18
### Content-addressed images
@@ -24,9 +24,9 @@ tags are aliases on the same manifest. Run it locally with `pnpm app:sha`.
24
24
25
25
Two things fall out of that. `publish-ghcr-image.yml` probes GHCR for the content SHA and skips both
26
26
arch builds when it is already published. And because the image tag is what Terraform pins, the task
27
-
definition of such a release is byte-identical, so `deploy-dev.yml`and `deploy-prod.yml` skip the ECS
28
-
roll too — each compares the revision the apply registered against the one the service runs. Terraform
29
-
still applies every release; terraform changes are exactly what these releases carry.
27
+
definition of such a release is byte-identical, so `deploy.yml`skips the ECS roll too — it compares
28
+
the revision the apply registered against the one the service runs. Terraform still applies every
29
+
release; terraform changes are exactly what these releases carry.
30
30
31
31
The footer therefore shows the release that last *changed* the app, not the one being cut — that is
32
32
what is running. `APP_VERSION` reaches the container at start rather than being baked in, and the
@@ -45,38 +45,70 @@ fail. The alias resolves to the same manifest, and the ECR destination stays con
45
45
46
46
## Workflows
47
47
48
-
### Dev Deployment (`deploy-dev.yml`)
48
+
### Deployment (`deploy.yml`)
49
49
50
-
**Triggers:**
51
-
- Completion of `publish-ghcr-image.yml`, so the image is guaranteed to exist rather than polled for
52
-
- Manual dispatch with a version tag (break-glass, e.g. to roll back)
50
+
One workflow for both environments, with the target derived from the trigger. Dev and prod deploy the
51
+
same image, so parity is structural rather than maintained by hand.
52
+
53
+
| Trigger | Target |
54
+
|---|---|
55
+
| Completion of `publish-ghcr-image.yml`| dev — the image is guaranteed to exist rather than polled for |
56
+
| A GitHub Release being published | prod — the single draft `prepare-release.yml` left |
57
+
| Manual dispatch | either, chosen by the `environment` input (break-glass, e.g. to roll back) |
53
58
54
59
**Jobs:**
55
-
1.`guard` - Resolves the tag and its content SHA, and refuses anything not reachable from `main`
56
-
2.`promote` - Copies the GHCR manifest list into ECR as `dev-app-<sha>`, keeping both arches. Skipped when that tag is already there
60
+
1.`guard` - Resolves the target, the tag and its content SHA, refuses anything not reachable from `main`, and derives the per-environment names below
61
+
2.`promote` - Copies the GHCR manifest list into that account's ECR, keeping both arches. Each tag is written only if absent
57
62
3.`terraform` - Applies each stack serially in dependency order, planning immediately before each apply
58
-
4.`roll` - Moves the service to the new task definition revision unless it already runs it, then checks `/api/health` and that `/api/metrics` is 403
59
-
5.`draft-release` - Calls `prepare-release.yml` (not on dispatch)
63
+
4.`roll` - Moves the service to the new task definition revision unless it already runs it, then checks `/api/health` and that `/api/metrics` is 403, both over the ALB by name
64
+
5.`draft-release` - Calls `prepare-release.yml` (dev only, and not on dispatch)
0 commit comments