@@ -6,63 +6,72 @@ name: CI
6
6
on :
7
7
# Triggers the workflow on push or pull request events but only for the master branch
8
8
push :
9
- branches : [ master ]
10
- pull_request :
11
- branches : [ master ]
9
+ tags :
10
+ - ' v*.*.*'
12
11
13
12
# Allows you to run this workflow manually from the Actions tab
14
13
workflow_dispatch :
15
14
16
15
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17
16
jobs :
18
17
# This workflow contains a single job called "build"
19
- build :
18
+ build-mlflow :
20
19
# The type of runner that the job will run on
21
20
runs-on : ubuntu-latest
22
21
23
22
# Steps represent a sequence of tasks that will be executed as part of the job
24
23
steps :
25
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26
- - uses : actions/checkout@v2
27
-
28
- - name : Login to Docker Hub
29
- uses : docker/login-action@v1
24
+ - name : Checkout Repo ✅
25
+ uses : actions/checkout@v2
26
+
27
+ - uses : ./.github/actions/shared-build-steps
28
+
29
+ - name : Docker meta 💬
30
+ id : meta
31
+ uses : docker/metadata-action@v5
30
32
with :
31
- username : ${{ secrets.DOCKERHUB_USER }}
32
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
33
+ images : codecentric/from-jupyter-to-production-mlflow
33
34
34
- - name : Set up QEMU
35
- uses : docker/setup-qemu-action@v1
35
+ - name : Build and push mlflow Docker image 🔨🐳
36
+ id : docker_build_mlflow
37
+
36
38
with :
37
- platforms : amd64,arm64
38
- - name : free disk space
39
- run : |
40
- sudo swapoff -a
41
- sudo rm -f /swapfile
42
- sudo apt clean
43
- docker rmi $(docker image ls -aq)
44
- df -h
39
+ context : .
40
+ file : ./docker/mlflow/Dockerfile
41
+ tags : ${{ steps.meta.outputs.tags }}
42
+ push : ${{ github.event_name != 'pull_request' }}
43
+ builder : ${{ steps.buildx.outputs.name }}
44
+ cache-from : type=local,src=/tmp/.buildx-cache
45
+ cache-to : type=local,dest=/tmp/.buildx-cache
46
+ platforms : linux/amd64,linux/arm64
45
47
46
- - name : Set up Docker Buildx
47
- id : buildx
48
- uses : docker/setup-buildx-action@v1
48
+ - name : Image digest
49
+ run : echo ${{ steps.docker_build.outputs.digest }}
50
+ build-jupyter :
51
+ # The type of runner that the job will run on
52
+ runs-on : ubuntu-latest
49
53
50
- - name : Cache Docker layers
51
- uses : actions/cache@v2
54
+ # Steps represent a sequence of tasks that will be executed as part of the job
55
+ steps :
56
+ - name : Checkout Repo ✅
57
+ uses : actions/checkout@v2
58
+
59
+ - uses : ./.github/actions/shared-build-steps
60
+
61
+ - name : Docker meta 💬
62
+ id : meta
63
+ uses : docker/metadata-action@v5
52
64
with :
53
- path : /tmp/.buildx-cache
54
- key : ${{ runner.os }}-buildx-${{ github.sha }}
55
- restore-keys : |
56
- ${{ runner.os }}-buildx-
57
-
58
- - name : Build and push mlflow Docker image
59
- id : docker_build_amd64_mlflow
65
+ images : codecentric/from-jupyter-to-production-jupyter
66
+
67
+ - name : Build and push juypter Docker image 🔨🐳
68
+ id : docker_build_mlflow
60
69
61
70
with :
62
71
context : .
63
- file : ./docker/mlflow /Dockerfile
64
- tags : codecentric/from-jupyter-to-production-mlflow:1.0.0
65
- push : true
72
+ file : ./docker/jupyter /Dockerfile
73
+ tags : ${{ steps.meta.outputs.tags }}
74
+ push : ${{ github.event_name != 'pull_request' }}
66
75
builder : ${{ steps.buildx.outputs.name }}
67
76
cache-from : type=local,src=/tmp/.buildx-cache
68
77
cache-to : type=local,dest=/tmp/.buildx-cache
0 commit comments