-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1 KB
/
docker.yml
File metadata and controls
43 lines (35 loc) · 1 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
name: Docker CI
on:
push:
branches: [main, master]
pull_request:
jobs:
build-and-run:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t scyros-tutorial .
- name: Run container
run: |
docker run -d --name scyros-tutorial-test -p 8501:8501 scyros-tutorial
- name: Wait for app to become ready
run: |
for i in {1..30}; do
if curl --silent --fail http://127.0.0.1:8501 > /dev/null; then
echo "App is up"
exit 0
fi
echo "Waiting for app..."
sleep 2
done
echo "App did not become ready in time"
docker logs scyros-tutorial-test
exit 1
- name: Print container logs
if: always()
run: docker logs scyros-tutorial-test
- name: Stop container
if: always()
run: docker rm -f scyros-tutorial-test