fix(build): .dockerignore not picked up

Using the git context of the build-push-action ignores the .dockerignore because it is pulled by buildkit. Instead use checkout action and use the path context.
This commit is contained in:
Bram van Meurs 2024-04-18 09:54:10 +01:00 committed by GitHub
parent fa8a9568aa
commit e9d3cd37d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,6 +25,9 @@ jobs:
if: github.repository == 'BerriAI/litellm' if: github.repository == 'BerriAI/litellm'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
-
name: Checkout
uses: actions/checkout@v4
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@ -41,12 +44,14 @@ jobs:
name: Build and push name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: .
push: true push: true
tags: litellm/litellm:${{ github.event.inputs.tag || 'latest' }} tags: litellm/litellm:${{ github.event.inputs.tag || 'latest' }}
- -
name: Build and push litellm-database image name: Build and push litellm-database image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: .
push: true push: true
file: Dockerfile.database file: Dockerfile.database
tags: litellm/litellm-database:${{ github.event.inputs.tag || 'latest' }} tags: litellm/litellm-database:${{ github.event.inputs.tag || 'latest' }}
@ -54,6 +59,7 @@ jobs:
name: Build and push litellm-spend-logs image name: Build and push litellm-spend-logs image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: .
push: true push: true
file: ./litellm-js/spend-logs/Dockerfile file: ./litellm-js/spend-logs/Dockerfile
tags: litellm/litellm-spend_logs:${{ github.event.inputs.tag || 'latest' }} tags: litellm/litellm-spend_logs:${{ github.event.inputs.tag || 'latest' }}
@ -92,7 +98,7 @@ jobs:
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@4976231911ebf5f32aad765192d35f942aa48cb8 uses: docker/build-push-action@4976231911ebf5f32aad765192d35f942aa48cb8
with: with:
context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} context: .
push: true push: true
tags: ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.release_type }} # if a tag is provided, use that, otherwise use the release tag, and if neither is available, use 'latest' tags: ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.release_type }} # if a tag is provided, use that, otherwise use the release tag, and if neither is available, use 'latest'
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
@ -128,7 +134,7 @@ jobs:
- name: Build and push Database Docker image - name: Build and push Database Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with: with:
context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} context: .
file: Dockerfile.database file: Dockerfile.database
push: true push: true
tags: ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.release_type }} tags: ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.release_type }}
@ -165,7 +171,7 @@ jobs:
- name: Build and push Database Docker image - name: Build and push Database Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with: with:
context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} context: .
file: ./litellm-js/spend-logs/Dockerfile file: ./litellm-js/spend-logs/Dockerfile
push: true push: true
tags: ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.release_type }} tags: ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.release_type }}