Skip to content

Commit f384e7e

Browse files
ci: update distro container action with smoke test
Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
1 parent bc39404 commit f384e7e

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

.github/workflows/redhat-distro-container-build.yml renamed to .github/workflows/redhat-distro-container.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Publish Redhat Distribution Container for Multi-Arch
1+
name: Build, test, and publish Red Hat Distribution Containers
22

33
on:
44
pull_request:
@@ -21,8 +21,7 @@ env:
2121
IMAGE_NAME: quay.io/opendatahub/llama-stack
2222

2323
jobs:
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

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ repos:
3535
args: [ --fix ]
3636
- id: ruff-format
3737

38+
- repo: https://github.com/rhysd/actionlint
39+
rev: v1.7.7
40+
hooks:
41+
- id: actionlint
42+
3843
- repo: local
3944
hooks:
4045
- id: pkg-gen

0 commit comments

Comments
 (0)