forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.11 KB
/
push-images.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Push-Images
on:
release:
types:
- published
- edited
jobs:
push-images:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-python
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Gather Docker Metadata for Tracking
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/mlflow/mlflow
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=tag
- name: Build and Push Base Image
uses: docker/build-push-action@v3
with:
context: docker
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
VERSION=${{ steps.meta.outputs.version }}
- name: Gather Docker Metadata for Model Server
id: modelmeta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/mlflow/model-server
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=tag
- name: Build Model Server Image
run: |
pip install -e .
mlflow models build-docker -n model-server:latest --mlflow-home `pwd`
- name: Push Model Server Image
run: |
set -x
tags=$(echo -n "${{ steps.modelmeta.outputs.tags }}" | tr '\n' ' ')
for tag in $tags; do
docker tag model-server:latest $tag
docker push $tag
done