diff --git a/.github/workflows/docker-compose-ci.yml b/.github/workflows/docker-compose-ci.yml index b5f0a12..35ebea3 100644 --- a/.github/workflows/docker-compose-ci.yml +++ b/.github/workflows/docker-compose-ci.yml @@ -1,30 +1,24 @@ -name: Build and Push Docker Image +# .github/workflows/docker-compose-ci.yml +name: Build & Push (Compose/Bake) on: push: branches: [ "main", "master" ] + # enable when you want release builds from tags + # push: + # tags: [ "v*" ] jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - service: - - name: usermanagementapi - context: . - dockerfile: UserManagementApi/Dockerfile - - name: loggingapi - context: . - dockerfile: CentralizedLoggingApi/Dockerfile - - name: integrationportal - context: . - dockerfile: ApiIntegrationMvc/Dockerfile - + steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Set up Docker Buildx + - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub @@ -40,10 +34,20 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push images - uses: docker/build-push-action@v6 + # Optional: quick sanity check that compose is at repo root + - name: Show tree + run: | + pwd + ls -la + test -f docker-compose.yml && echo "compose found" || (echo "compose missing" && exit 1) + + - name: Build & Push with Bake (compose) + uses: docker/bake-action@v4 with: + files: | + docker-compose.yml push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/centralized-logging:latest - ghcr.io/hasanjaved-developer/centralized-logging:latest + # You can override or add tags/labels per-target with `set:` if needed + # set: | + # *.labels=org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + # *.tags=ghcr.io/hasanjaved-developer/centralized-logging/{{.target}}:edge