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
46 changes: 25 additions & 21 deletions .github/workflows/docker-compose-ci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Loading