Skip to content

Onboard renovate (#39) #36

Onboard renovate (#39)

Onboard renovate (#39) #36

Workflow file for this run

#
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI/CD
on:
push:
branches: [ main ]
release:
types: [ published ]
env:
IMAGE_NAME: llama-stack
IMAGE_REGISTRY: quay.io
REGISTRY_ORG: redhat-ai-dev
CONTAINER_FILE: Containerfile
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Install buildah
run: |
sudo apt update
sudo apt install -y buildah qemu-user-static
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Determine tags
id: tags
run: |
if [ "${GITHUB_EVENT_NAME}" = "release" ]; then
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "latest" >> $GITHUB_OUTPUT
echo "${GITHUB_SHA}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Build image with Buildah
id: build_image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2.13
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.tags.outputs.tags }}
containerfiles: |
${{ env.CONTAINER_FILE }}
archs: amd64, arm64
oci: true
- name: Check images
run: |
buildah images | grep '${{ env.IMAGE_NAME }}'
echo 'Image: ${{ steps.build_image.outputs.image }}'
echo 'Tags: ${{ steps.build_image.outputs.tags }}'
- name: Check manifest
run: |
set -x
if [[ "${{ github.event_name }}" == "release" ]]; then
buildah manifest inspect ${{ steps.build_image.outputs.image }}:${{ github.event.release.tag_name }}
else
buildah manifest inspect ${{ steps.build_image.outputs.image }}:latest
fi
- name: Push image to Quay.io
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_ORG }}
username: ${{ secrets.QUAY_REGISTRY_USERNAME }}
password: ${{ secrets.QUAY_REGISTRY_PASSWORD }}