Skip to content

update deployment doc (#25) #32

update deployment doc (#25)

update deployment doc (#25) #32

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
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@v4
- 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@v2
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@v2
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 }}