From fd05892dd6a6b53e4473c1c81d4c0eaa7b657731 Mon Sep 17 00:00:00 2001 From: Albert Sebastian Date: Mon, 13 Apr 2026 10:16:13 +0530 Subject: [PATCH] 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) --- .github/workflows/build-push.yml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build-push.yml diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml new file mode 100644 index 00000000000..cab84d041c0 --- /dev/null +++ b/.github/workflows/build-push.yml @@ -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