1- name : Build and Publish Redhat Distribution Container for Multi-Arch
1+ name : Build, test, and publish Red Hat Distribution Containers
22
33on :
44 pull_request :
2121 IMAGE_NAME : quay.io/opendatahub/llama-stack
2222
2323jobs :
24- build-and-push :
25- name : Build and Push Container
24+ build-test-push :
2625 runs-on : ubuntu-latest
2726 strategy :
2827 matrix :
@@ -38,20 +37,40 @@ jobs:
3837 - name : Set up Docker Buildx
3938 uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
4039
40+ - name : Build image
41+ id : build
42+ uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
43+ with :
44+ context : .
45+ file : distribution/Containerfile
46+ platforms : ${{ matrix.platform }}
47+ push : false
48+ tags : ${{ env.IMAGE_NAME }}:${{ github.sha }}
49+ load : true # needed to load for smoke test
50+
51+ - name : Test image
52+ id : test
53+ run : |
54+ docker run --rm \
55+ --env "INFERENCE_MODEL=dummy" \
56+ ${{ env.IMAGE_NAME }}:${{ github.sha }}
57+
4158 - name : Log in to Quay.io
59+ id : login
4260 if : github.event_name == 'push'
4361 uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
4462 with :
4563 registry : ${{ env.REGISTRY }}
4664 username : ${{ secrets.QUAY_USERNAME }}
4765 password : ${{ secrets.QUAY_PASSWORD }}
4866
49- - name : Build image and push to quay.io only on push event
50- id : build
67+ - name : Publish image to Quay.io
68+ id : publish
69+ if : github.event_name == 'push'
5170 uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
5271 with :
5372 context : .
5473 file : distribution/Containerfile
5574 platforms : ${{ matrix.platform }}
56- push : ${{ github.event_name == 'push' }}
75+ push : true
5776 tags : ${{ env.IMAGE_NAME }}:${{ github.sha }},${{ env.IMAGE_NAME }}:latest
0 commit comments