ci: add GitHub Actions workflow to build and push to Azure ACR

Builds the LiteLLM Docker image on push to main and fix/* branches,
then pushes to Azure Container Registry with commit SHA and latest tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Albert Sebastian 2026-04-13 10:16:13 +05:30
parent b60e30a58b
commit fd05892dd6

35
.github/workflows/build-push.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Build and Push LiteLLM Image
on:
push:
branches: [main, fix/*]
workflow_dispatch:
env:
REGISTRY: ${{ secrets.AZURE_DASH_REGISTRY_URL }}
IMAGE_NAME: litellm-proxy
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_ID }}
password: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_SECRET }}
- name: Get short SHA
uses: benjlevesque/short-sha@v2.1
id: short-sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.short-sha.outputs.sha }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest