diff --git a/.github/workflows/docker-compose-ci.yml b/.github/workflows/docker-compose-ci.yml new file mode 100644 index 0000000..d023b99 --- /dev/null +++ b/.github/workflows/docker-compose-ci.yml @@ -0,0 +1,37 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + 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/${{ github.repository_owner }}/centralized-logging:latest