Merge pull request #1363 from Open-Source-Legal/dependabot/pip/mcp-gt… #169
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Build CUDA Images | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag for the images' | |
| required: true | |
| default: 'cuda-latest' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'compose/**/Dockerfile' | |
| - 'requirements/**' | |
| - '.github/workflows/docker-build-cuda.yml' | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build-cuda-images: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| strategy: | |
| matrix: | |
| include: | |
| - image: django | |
| context: . | |
| dockerfile: ./compose/production/django/Dockerfile | |
| platforms: linux/amd64 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Convert repository owner to lowercase | |
| id: repo | |
| run: | | |
| echo "owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Determine tag | |
| id: tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=cuda-${{ github.sha }}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build and push CUDA Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ${{ matrix.context }} | |
| file: ${{ matrix.dockerfile }} | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ steps.repo.outputs.owner }}/opencontractserver_${{ matrix.image }}:${{ steps.tag.outputs.tag }} | |
| ${{ env.REGISTRY }}/${{ steps.repo.outputs.owner }}/opencontractserver_${{ matrix.image }}:cuda-latest | |
| labels: | | |
| org.opencontainers.image.source=${{ github.repository }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| cuda.version=12.6 | |
| pytorch.version=2.7.1 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: ${{ matrix.platforms }} | |
| build-args: | | |
| BUILD_ENVIRONMENT=production | |
| PYTORCH_VERSION=2.7.1-cuda12.6-cudnn9-runtime |