ci: validate both Caddyfiles in the test job (#26)
The test image swaps in Caddyfile.test, so the production Caddyfile was never exercised by CI: the parse error from issue #20 sailed through every check and only surfaced when the deploy gate failed — after the broken container had already replaced the healthy one. Running `caddy validate` (same caddy:2-alpine base as the Dockerfile) on both files up front fails the PR check in seconds instead. Touches the frozen .github/workflows/ per explicit product-owner approval in #26. Closes #26 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -11,6 +11,18 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# The test image below swaps in Caddyfile.test, so the production
|
||||||
|
# Caddyfile is otherwise never exercised by CI — an invalid config then
|
||||||
|
# only surfaces when the deploy health-gate fails, after the broken
|
||||||
|
# container already replaced the healthy one (issue #20/#26). Validate
|
||||||
|
# both files up front so a parse error fails the PR check in seconds.
|
||||||
|
- name: Validate Caddyfiles
|
||||||
|
run: |
|
||||||
|
docker run --rm -v "$PWD":/workspace -w /workspace caddy:2-alpine \
|
||||||
|
caddy validate --config Caddyfile --adapter caddyfile
|
||||||
|
docker run --rm -v "$PWD":/workspace -w /workspace caddy:2-alpine \
|
||||||
|
caddy validate --config Caddyfile.test --adapter caddyfile
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t learning-platform .
|
run: docker build -t learning-platform .
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user