Skip to content

Commit abfbdff

Browse files
authored
Merge pull request #3 from amazeeio/amazeeio-main
add GitHub Actions workflow for building and publishing LiteLLM Docker image
2 parents 5ee6007 + f7499e4 commit abfbdff

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# this workflow is triggered by an API call when there is a new PyPI release of LiteLLM
2+
name: Build, Publish LiteLLM Docker Image.
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
# Defines two custom environment variables for the workflow. Used for the Container registry domain, and a name for the Docker image that this workflow builds.
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
15+
jobs:
16+
# print commit hash, tag, and release type
17+
print:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- run: |
21+
echo "Commit hash: ${{ github.event.inputs.commit_hash }}"
22+
echo "Tag: ${{ github.event.inputs.tag }}"
23+
echo "Release type: ${{ github.event.inputs.release_type }}"
24+
25+
build-and-push-image-database:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
packages: write
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract metadata (tags, labels) for database Dockerfile
42+
id: meta-database
43+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-database
46+
# Configure multi platform Docker builds
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@e0e4588fad221d38ee467c0bffd91115366dc0c5
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@edfb0fe6204400c56fbfd3feba3fe9ad1adfa345
51+
52+
- name: Build and push Database Docker image
53+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
54+
with:
55+
context: .
56+
file: ./docker/Dockerfile.database
57+
push: true
58+
tags: |
59+
${{ steps.meta-database.outputs.tags }}
60+
labels: ${{ steps.meta-database.outputs.labels }}
61+
platforms: linux/amd64
62+

0 commit comments

Comments
 (0)