-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.15 KB
/
docker.yml
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
name: Docker
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build_and_run_docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and run with Docker Compose
run: |
touch ./service/.env
docker-compose up --build -d
sleep 10
- name: Check frontend accessible
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000)
if [[ "$response" == "200" ]]; then
echo "Application launched successfully"
else
echo "Application failed to launch"
exit 1
fi
- name: Check backend accessible
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5000/health)
if [[ $response == "200" ]]; then
echo "Health check passed"
else
echo "Health check failed with status code $response"
exit 1
fi
- name: Cleanup
if: always()
run: docker-compose down