Skip to content

Commit 117f70e

Browse files
AlexF4Devclaude
andcommitted
document secrets strategy: .env for tags, .env.secrets for sensitive values
Add Secrets section to README explaining the separation. Add clarifying comment to .env template and demo files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 81b166d commit 117f70e

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ A simplified [Argo CD](https://argo-cd.readthedocs.io/en/stable/)-style reconcil
44

55
Image tags live in a `.env` file alongside `docker-compose.yaml` — Docker Compose [loads it automatically](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). CI updates `.env` with simple `source`/`sed` (no `yq` needed).
66

7+
> **Note:** The `.env` file is committed to git and contains only image tags — never secrets. See [Secrets](#secrets) for how to handle sensitive values.
8+
79
## Structure
810

911
```
@@ -78,6 +80,28 @@ gh workflow run "CI: Deploy (Demo)"
7880

7981
CI runs automatically on push to main and PRs with 5 parallel validation jobs.
8082

83+
## Secrets
84+
85+
The `.env` file is for image tags only and is committed to git. Keep secrets separate:
86+
87+
```yaml
88+
# docker-compose.yaml
89+
services:
90+
backend:
91+
image: "ghcr.io/myorg/backend:${BACKEND_TAG}"
92+
env_file:
93+
- .env.secrets # API keys, DB passwords — gitignored, not managed by CI
94+
environment:
95+
- NODE_ENV=production
96+
```
97+
98+
```bash
99+
# .gitignore
100+
.env.secrets
101+
```
102+
103+
This way CI manages `.env` (tags) and your secrets stay in `.env.secrets` (or are injected via the host environment, a secrets manager, etc.). The two files serve different purposes and have different lifecycles.
104+
81105
## Key Patterns
82106

83107
- **Two-layer change detection** — Semantic tag comparison + GitHub `paths` filter

demo/projects/demo-app/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# Image tags — managed by CI. Not for secrets (use .env.secrets or env_file).
12
BACKEND_TAG=0.24.0
23
FRONTEND_TAG=0.23.0

templates/gitops-ci/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# Image tags — managed by CI. Not for secrets (use .env.secrets or env_file).
12
BACKEND_TAG=0.0.0
23
FRONTEND_TAG=0.0.0

0 commit comments

Comments
 (0)