diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80c9db9..73cf8fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,8 +75,8 @@ jobs: name: logs-py${{ matrix.python-version }} path: .logs/ - docker: - name: Docker build + docker-build: + name: "\U0001F433 Docker build + smoke test" runs-on: ubuntu-latest needs: test steps: @@ -93,14 +93,39 @@ jobs: -e PYTHONPATH=/app/src \ -p 8000:8000 \ agentic-ai:ci - # Wait for startup for i in $(seq 1 20); do if curl -fsS http://127.0.0.1:8000/health; then - echo "Health OK" + echo " Health OK" break fi sleep 2 done - # Verify health endpoint curl -f http://127.0.0.1:8000/health docker stop smoke + + docker-ghcr: + name: "\U0001F433 Push to GHCR" + needs: [docker-build] + if: github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + target: runtime + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/agentic-ai:${{ github.sha }} + ghcr.io/${{ github.repository_owner }}/agentic-ai:latest