chore(infra): Add Docker Image CI workflow #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and run services with Docker Compose | |
# This builds both frontend and backend (assuming docker-compose.yml defines both) | |
run: | | |
docker compose -f docker-compose.yml up -d --build | |
docker compose -f docker-compose.yml ps | |
- name: Wait for services to initialize | |
run: | | |
echo "Waiting for services to become ready (checking ps)..." | |
for i in {1..15}; do | |
docker compose -f docker-compose.yml ps | |
sleep 2 | |
done | |
- name: Smoke test / show logs (customize endpoints as needed) | |
run: | | |
echo "=== Recent logs (tail 200) ===" | |
docker compose -f docker-compose.yml logs --no-color --tail=200 || true | |
# Example HTTP check (uncomment and adjust ports/endpoints for your app): | |
curl --fail http://localhost:8000/health || (docker compose -f docker-compose.yml logs && exit 1) |