-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.18 KB
/
docker_build_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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