forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (78 loc) · 2.35 KB
/
docker-chat.yml
File metadata and controls
89 lines (78 loc) · 2.35 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Check Chat Integration Docker
on:
pull_request:
branches:
- master
paths:
- 'integrations/chat/**'
- 'packages/sdk/**'
permissions:
id-token: write
contents: read
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
build-and-test:
runs-on: depot-ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Build Docker image
uses: depot/build-push-action@v1
with:
project: ${{ secrets.DEPOT_PROJECT_ID }}
build-args: |
MINIFY=true
file: ./integrations/chat/Dockerfile
context: .
push: false
load: true
tags: chat-integration:test
- name: Start Docker container
run: |
docker run -d \
--name chat-test \
-p 8081:8081 \
-e SECRET_SIGNAL_URL=https://chat.botpress.dev \
chat-integration:test
- name: Wait for container to be ready
run: |
echo "Waiting for container to start..."
for i in {1..30}; do
if docker ps --filter "name=chat-test" --filter "status=running" | grep -q chat-test; then
echo "Container is running"
sleep 5
exit 0
fi
if docker ps -a --filter "name=chat-test" --filter "status=exited" | grep -q chat-test; then
echo "Container exited prematurely!"
docker logs chat-test
exit 1
fi
echo "Waiting for container... ($i/30)"
sleep 2
done
echo "Container did not start within expected time"
docker ps -a
exit 1
- name: Check health endpoint
run: |
echo "Checking /health endpoint..."
for i in {1..15}; do
if curl -f http://localhost:8081/health; then
echo "Health check passed!"
exit 0
fi
echo "Attempt $i/15 failed, retrying..."
sleep 2
done
echo "Health check failed after 15 attempts"
exit 1
- name: Show container logs on failure
if: failure()
run: docker logs chat-test
- name: Cleanup container
if: always()
run: docker rm -f chat-test || true