Update Blender mirror URL in Dockerfile #2
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'Dockerfile' | |
| env: | |
| REGISTRY: ${{ secrets.DOCKERHUB_USERNAME }} | |
| IMAGE_NAME: ${{ secrets.DOCKERHUB_REPO }} | |
| BLENDER_MIRROR_URL: ${{ secrets.BLENDER_MIRROR_URL }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| blender_version: | |
| - { version: "3.4.1", short: "3.4" } | |
| - { version: "3.5.1", short: "3.5" } | |
| - { version: "3.6.18", short: "3.6" } | |
| - { version: "4.0.2", short: "4.0" } | |
| - { version: "4.1.1", short: "4.1" } | |
| - { version: "4.2.4", short: "4.2" } | |
| - { version: "4.3.0", short: "4.3" } | |
| ubuntu_cuda_version: | |
| - { version: "11.7.1-cudnn8-devel-ubuntu20.04", short: "cuda11.7.1-ubuntu20.04" } | |
| - { version: "11.7.1-cudnn8-devel-ubuntu22.04", short: "cuda11.7.1-ubuntu22.04" } | |
| - { version: "11.8.0-cudnn8-devel-ubuntu20.04", short: "cuda11.8.0-ubuntu20.04" } | |
| - { version: "11.8.0-cudnn8-devel-ubuntu22.04", short: "cuda11.8.0-ubuntu22.04" } | |
| - { version: "12.1.1-cudnn8-devel-ubuntu20.04", short: "cuda12.1.1-ubuntu20.04" } | |
| - { version: "12.1.1-cudnn8-devel-ubuntu22.04", short: "cuda12.1.1-ubuntu22.04" } | |
| - { version: "12.4.1-cudnn-devel-ubuntu20.04", short: "cuda12.4.1-ubuntu20.04" } | |
| - { version: "12.4.1-cudnn-devel-ubuntu22.04", short: "cuda12.4.1-ubuntu22.04" } | |
| - { version: "12.6.3-cudnn-devel-ubuntu20.04", short: "cuda12.6.3-ubuntu20.04" } | |
| - { version: "12.6.3-cudnn-devel-ubuntu22.04", short: "cuda12.6.3-ubuntu22.04" } | |
| - { version: "12.6.3-cudnn-devel-ubuntu24.04", short: "cuda12.6.3-ubuntu24.04" } | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Set up Docker Buildx | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # Log in to Docker Hub | |
| - name: Log in to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # Cache Docker layers | |
| - name: Cache Docker layers | |
| uses: actions/cache@v3 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }} | |
| restore-keys: | | |
| ${{ runner.os }}-docker- | |
| # Extract metadata for Docker | |
| - name: Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| # Build and push Docker image | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| provenance: false # Disable provenance if unsupported | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:blender-${{ matrix.blender_version.short }}-${{ matrix.ubuntu_cuda_version.short }} | |
| build-args: | | |
| BLENDER_VERSION=${{ matrix.blender_version.version }} | |
| UBUNTU_CUDA_VERSION=${{ matrix.ubuntu_cuda_version.version }} | |
| BLENDER_MIRROR_URL=${{ env.BLENDER_MIRROR_URL }} | |
| cache-from: type=gha,scope=build-cache | |
| cache-to: type=gha,mode=max,scope=build-cache |