Skip to content

fix build and push pipeline #2

fix build and push pipeline

fix build and push pipeline #2

name: Build & Push to DockerHub
on:
push:
branches: [ "master" ]
paths:
- '.github/workflows/docker_build_push.yml'
- 'aggregation/**'
- 'ai-image-classifier/**'
- 'content/**'
- 'gateway/**'
- 'postprocessing/**'
- 'users/**'
jobs:
push:
runs-on: ubuntu-latest
strategy:
matrix:
service: [aggregation, ai-image-classifier, content, gateway, postprocessing, users]
steps:
- uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Define repository name
run: echo "REPO_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/dp-${{ matrix.service }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ${{ matrix.service }}
file: ${{ matrix.service }}/Dockerfile
tags: |
${{ env.REPO_NAME }}:${{ github.sha }}
${{ env.REPO_NAME }}:latest
push: true