-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (62 loc) · 2.2 KB
/
workflow.docker.build.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build & publish PDK images
on:
pull_request:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfolder: examples/training_container/
prefix: train
- dockerfolder: examples/brain-mri/container/deploy/
prefix: brain-deploy
- dockerfolder: examples/dog-cat/container/deploy/
prefix: dog-cat-deploy
- dockerfolder: examples/object-detection/container/deploy/
prefix: object-detection-deploy
- dockerfolder: examples/sentiment-analysis/container/deploy/
prefix: sentiment-analysis-deploy
- dockerfolder: examples/sentiment-analysis/container/prep/
prefix: sentiment-analysis-prep
- dockerfolder: bring-your-own-model/PDK_implementation/container/deploy/
prefix: byom-deploy
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
dockerchange:
- '${{ matrix.dockerfolder }}**'
-
name: Docker meta
id: meta
if: steps.filter.outputs.dockerchange == 'true'
uses: docker/metadata-action@v5
with:
images: pachyderm/pdk
tags: |
# branch event
type=sha,prefix=${{ matrix.prefix }}-,event=branch
# tag event
type=ref,prefix=${{ matrix.prefix }}-,event=tag
flavor: |
-
name: Login to Docker Hub
uses: docker/login-action@v3
if: steps.filter.outputs.dockerchange == 'true'
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
if: steps.filter.outputs.dockerchange == 'true'
with:
context: ${{ matrix.dockerfolder }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}