-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.44 KB
/
ci.yml
File metadata and controls
47 lines (42 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: ci
on: push
jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Build the stack
run: docker-compose -f Project/compose.yaml build
# Container starten
- name: Start services
run: docker-compose -f Project/compose.yaml up -d
# Healthcheck / Test
# - name: Run tests
# run: |
# docker ps
# curl -s --retry 10 --retry-connrefused http://localhost:8000/
# - name: Test
# run: docker run --network container:webapp-frontend appropriate/curl -s --retry 10 --retry-connrefused http://localhost:5000/
- name: Wait for frontend on :8000
run: |
PORT=8000
attempts=30
wait_seconds=3
for i in $(seq 1 $attempts); do
if curl -fsSL --retry-all-errors --retry 0 "http://localhost:${PORT}/" >/dev/null 2>&1; then
echo "ready"
exit 0
fi
echo "waiting... ($i)"
sleep $wait_seconds
done
echo "service not ready" >&2
docker-compose -f Project/compose.yaml ps || true
docker-compose -f Project/compose.yaml logs || true
exit 1
- name: Smoke test
run: curl -fsSL -o /dev/null http://localhost:8000/