Skip to content

Commit 44deee4

Browse files
Copilotdannystaple
andcommitted
Replace manual wait loop with docker compose --wait and move cache config to CI override
Co-authored-by: dannystaple <[email protected]>
1 parent c295d1a commit 44deee4

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.github/workflows/on_call_staging_test.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ jobs:
2525
2626
- name: Run as service and test
2727
run: |
28-
# Start the staging service using docker compose (context will be _site now)
29-
docker compose up -d --build staging
30-
31-
# Wait for the health check to pass (healthcheck should handle readiness)
32-
echo "Waiting for service to be ready..."
33-
timeout 60 bash -c 'until curl -f http://localhost:8080/ >/dev/null 2>&1; do sleep 2; done'
28+
# Start the staging service using docker compose with --wait for health checks
29+
# Use CI-specific override for GitHub Actions cache
30+
docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --build --wait staging
3431
3532
# Perform the tests
3633
set +e # Don't exit on error so we can clean up
@@ -41,7 +38,7 @@ jobs:
4138
curl -I -f http://localhost:8080/wiki/lego || exit_code=1
4239
4340
# Stop the service regardless of test outcome
44-
docker compose stop staging
41+
docker compose -f docker-compose.yml -f docker-compose.ci.yml stop staging
4542
4643
# Exit with the test result
4744
exit $exit_code

docker-compose.ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
staging:
3+
build:
4+
cache_from:
5+
- type=gha
6+
cache_to:
7+
- type=gha,mode=max

docker-compose.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ services:
109109
build:
110110
context: ./_site
111111
dockerfile: ../.github/scripts/staging/Dockerfile
112-
cache_from:
113-
- type=gha
114-
cache_to:
115-
- type=gha,mode=max
116112
ports:
117113
- 8080:80
118114
healthcheck:

0 commit comments

Comments
 (0)