Skip to content

Debug: use print for model listing logs to ensure visibility #18

Debug: use print for model listing logs to ensure visibility

Debug: use print for model listing logs to ensure visibility #18

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ "main" ] # Trigger the pipeline on pushes to the main branch
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image_name: ${{ steps.image_info.outputs.lowercase_image }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set image name to lowercase
id: image_info
run: |
IMAGE_NAME_LC=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "lowercase_image=$IMAGE_NAME_LC" >> $GITHUB_OUTPUT
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image_info.outputs.lowercase_image }}
tags: |
type=raw,value=latest
type=raw,value=${{ github.sha }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Optional job to automatically update kubernetes deployment.
# This requires a kubernetes cluster setup and kubeconfig secret.
deploy:
needs: build-and-push
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
# Example step using an external tool to deploy, or setup kubectl
- name: Set up kubectl
uses: azure/setup-kubectl@v3
with:
version: 'latest'
- name: Configure Kubernetes context
uses: azure/k8s-set-context@v3
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}
- name: Update deployment image
run: |
IMAGE_NAME_LC=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
# Using commit SHA ensures a unique tag for every deployment, triggering a rollout
kubectl set image deployment/simple-rag-deployment simple-rag=$IMAGE_NAME_LC:${{ github.sha }}
kubectl rollout status deployment/simple-rag-deployment