Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/docker-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Docker Build Smoke Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
smoke-test:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
run: |
docker compose build \
--build-arg GIT_BRANCH="${{ github.ref_name }}" \
--build-arg GIT_COMMIT="${{ github.sha }}"

- name: Start container
run: docker compose up -d

- name: Wait for Streamlit to init and check health
run: |
echo "Waiting for Streamlit to be init..."
# checks the health endpoint every 5 seconds for up to 120 seconds
for i in {1..24}; do
if curl -s -f http://localhost:8501/_stcore/health > /dev/null; then
echo "✅ Streamlit is up and running!"
exit 0
fi
echo "Attempt $i: App not ready yet. Retrying in 5s..."
sleep 5
done

echo "❌ App failed to start within timeout."
exit 1

- name: Show container logs on failure
if: failure()
run: docker compose logs app

- name: Tear down
if: always()
run: docker compose down
Loading