1111 REGISTRY : ghcr.io
1212
1313jobs :
14- build-and-push :
14+ build-base-sql :
1515 runs-on : ubuntu-latest
1616 permissions :
1717 contents : read
1818 packages : write
1919
20- strategy :
21- fail-fast : false # Zorgt dat als één image faalt, de andere wel doorgaat
22- matrix :
23- include :
24- - image_name : custom-jupyter-sql
25- dockerfile : ./docker/Dockerfile.base-sql
26- - image_name : custom-jupyter-ai
27- dockerfile : ./docker/Dockerfile.ai-ext
20+ outputs :
21+ base_tag : ${{ steps.meta.outputs.version }}
2822
2923 steps :
3024 - name : Checkout repository
4438 id : meta
4539 uses : docker/metadata-action@v5
4640 with :
47- images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image_name }}
41+ images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/custom-jupyter-sql
4842 tags : |
4943 type=semver,pattern={{version}}
5044 type=semver,pattern={{major}}.{{minor}}
@@ -54,10 +48,55 @@ jobs:
5448 uses : docker/build-push-action@v5
5549 with :
5650 context : .
57- file : ${{ matrix.dockerfile }}
51+ file : ./docker/Dockerfile.base-sql
5852 push : true
5953 tags : ${{ steps.meta.outputs.tags }}
6054 labels : ${{ steps.meta.outputs.labels }}
6155 platforms : linux/amd64
6256 cache-from : type=gha
63- cache-to : type=gha,mode=max
57+ cache-to : type=gha,mode=max
58+
59+ build-ai-ext :
60+ runs-on : ubuntu-latest
61+ permissions :
62+ contents : read
63+ packages : write
64+ needs : build-base-sql
65+
66+ steps :
67+ - name : Checkout repository
68+ uses : actions/checkout@v4
69+
70+ - name : Set up Docker Buildx
71+ uses : docker/setup-buildx-action@v3
72+
73+ - name : Log in to GHCR
74+ uses : docker/login-action@v3
75+ with :
76+ registry : ${{ env.REGISTRY }}
77+ username : ${{ github.actor }}
78+ password : ${{ secrets.GITHUB_TOKEN }}
79+
80+ - name : Extract metadata
81+ id : meta
82+ uses : docker/metadata-action@v5
83+ with :
84+ images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/custom-jupyter-ai
85+ tags : |
86+ type=semver,pattern={{version}}
87+ type=semver,pattern={{major}}.{{minor}}
88+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
89+
90+ - name : Build and push
91+ uses : docker/build-push-action@v5
92+ with :
93+ context : .
94+ file : ./docker/Dockerfile.ai-ext
95+ push : true
96+ tags : ${{ steps.meta.outputs.tags }}
97+ labels : ${{ steps.meta.outputs.labels }}
98+ platforms : linux/amd64
99+ cache-from : type=gha
100+ cache-to : type=gha,mode=max
101+ build-args : |
102+ BASE_TAG=${{ needs.build-base-sql.outputs.base_tag }}
0 commit comments