Skip to content

dockerfile paths added #5

dockerfile paths added

dockerfile paths added #5

name: Build and Push Docker Image

Check failure on line 1 in .github/workflows/docker-compose-ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-compose-ci.yml

Invalid workflow file

(Line: 12, Col: 1): 'on' is already defined, (Line: 16, Col: 1): 'jobs' is already defined
on:
push:
branches: [ "main", "master" ]
jobs:
build:
runs-on: ubuntu-latest
name: Build and Push Docker Image
on:
push:
branches: [ "main", "master" ]
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
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push images
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/centralized-logging:latest
ghcr.io/hasanjaved-developer/centralized-logging:latest