-
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.74 KB
/
docker.yml
File metadata and controls
58 lines (49 loc) · 1.74 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
name: Docker Build & Test
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build -t invoiceflowbot:test .
- name: Test Docker image (build validation only)
run: |
echo "✅ Docker image built successfully"
docker images | grep invoiceflowbot
- name: Test container startup (without bot connection)
run: |
# Use valid token format for aiogram validation
# Format: bot_id:secret (aiogram requires this format)
docker run -d --name test-bot \
-e BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz \
-e MINDEE_API_KEY=test-key \
-e MINDEE_MODEL_ID=test-model \
invoiceflowbot:test || true
sleep 5
- name: Check container logs
run: |
echo "=== Container logs ==="
docker logs test-bot 2>&1 | head -20 || true
echo "=== Container status ==="
docker ps -a | grep test-bot || true
- name: Verify image structure
run: |
# Verify that the image has all necessary files
# Override entrypoint to avoid running bot.py
docker run --rm --entrypoint="" \
invoiceflowbot:test ls -la /app/bot.py /app/backend/config.py /app/backend/healthcheck.py || exit 1
echo "✅ Image structure is correct"
- name: Cleanup
if: always()
run: |
docker stop test-bot || true
docker rm test-bot || true