Skip to content

Commit 716ce15

Browse files
AlexF4Devclaude
andcommitted
move flow diagram to root README and simplify
Replace the dark-themed top-down Mermaid diagram with a clean left-to-right pipeline view using GitHub's native theme. Remove clutter (skip branches, disconnected cleanup subgraph). Template README links back to root. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7a4f42f commit 716ce15

2 files changed

Lines changed: 25 additions & 45 deletions

File tree

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ gh workflow run "CI: Deploy (Demo)"
3939
## Testing
4040

4141
```bash
42-
# Local smoke test (31 checks)
42+
# Local smoke test (32 checks)
4343
./test/smoke.sh
4444

4545
# Requires: yq, shellcheck (gracefully skips if missing)
@@ -49,9 +49,29 @@ CI runs automatically on push to main and PRs with 5 parallel validation jobs.
4949

5050
## How It Works
5151

52-
1. **Trigger** — Polls GHCR on a schedule for the latest semver image tags
53-
2. **PR Creation** — Compares with current `.env` file, creates a PR if versions differ
54-
3. **Deployment** — Merging the PR triggers deployment to the target server
52+
```mermaid
53+
flowchart LR
54+
subgraph trigger ["1. Trigger (ci-pr-trigger)"]
55+
A["Cron schedule"] --> B["Query GHCR API\n+ semver filter"]
56+
B --> C{"New tags?"}
57+
end
58+
59+
subgraph pr ["2. PR Creation (ci-create-release-pr)"]
60+
D["Read current\ntags from .env"] --> E{"Changed?"}
61+
E -- Yes --> F["Update .env\nvia sed"]
62+
F --> G["Create PR +\nauto-merge"]
63+
end
64+
65+
subgraph deploy ["3. Deployment"]
66+
H["PR merges"] --> I["paths filter"]
67+
I -- Match --> J["Copy files\nto server"]
68+
J --> K["docker compose\nup"]
69+
end
70+
71+
C -- Yes --> D
72+
G --> H
73+
K --> L["Slack notify"]
74+
```
5575

5676
Three deployment strategies: EC2/AWS, SSH, or self-hosted runner.
5777

templates/gitops-ci/README.md

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,7 @@ Reusable GitHub Actions template for automated GitOps deployments. Polls GHCR fo
44

55
## How it works
66

7-
```mermaid
8-
flowchart TD
9-
subgraph trigger ["ci-pr-trigger.yaml"]
10-
A["⏱ Cron (every 5 min)"] --> B["Query GHCR API"]
11-
B --> B1["ghcr-latest-tag action\n(paginate + semver filter)"]
12-
B1 --> C{New tags\nfound?}
13-
C -- No --> D["Skip"]
14-
end
15-
16-
subgraph pr ["ci-create-release-pr.yaml"]
17-
C -- Yes --> E["Read current tags\nfrom .env"]
18-
E --> F{"Tags\nchanged?"}
19-
F -- No --> G["Skip"]
20-
F -- Yes --> H["Update .env\nwith sed"]
21-
H --> I["Create PR\n(peter-evans/create-pull-request)"]
22-
I --> J["Enable auto-merge\n(retry w/ 15 min timeout)"]
23-
end
24-
25-
subgraph deploy ["ci-deployment.yaml"]
26-
J --> K["PR merges to\ndeploy branch"]
27-
K --> L{"Paths filter\nprojects/app/**"}
28-
L -- No match --> M["Skip"]
29-
L -- Match --> N["Copy files to server\n(SSH / rsync / local)"]
30-
N --> O["docker compose\npull / down / up"]
31-
O --> P["Extract deployed\nversions"]
32-
end
33-
34-
subgraph notify ["Notifications"]
35-
P --> Q["Slack notification\nwith versions + status"]
36-
end
37-
38-
subgraph cleanup ["Cleanup (parallel)"]
39-
A --> R["Delete old successful\nscheduled runs"]
40-
end
41-
42-
style trigger fill:#1a1a2e,stroke:#e94560,color:#eee
43-
style pr fill:#1a1a2e,stroke:#0f3460,color:#eee
44-
style deploy fill:#1a1a2e,stroke:#16213e,color:#eee
45-
style notify fill:#1a1a2e,stroke:#533483,color:#eee
46-
style cleanup fill:#1a1a2e,stroke:#4a4a4a,color:#eee
47-
```
7+
See the [flow diagram](../../README.md#how-it-works) in the root README.
488

499
1. **Trigger** (`ci-pr-trigger.yaml`) — Runs on schedule, queries GHCR for the latest semver image tags using the custom composite action
5010
2. **PR Creation** (`ci-create-release-pr.yaml`) — Compares discovered tags with current `.env` file. Creates a PR only if versions differ

0 commit comments

Comments
 (0)