Build and Publish Development Docker Image #372
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: Build and Publish Development Docker Image | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: [".NET Build Main"] | |
| branches: | |
| - main | |
| types: | |
| - completed | |
| jobs: | |
| generate-tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.settag.outputs.tag }} | |
| steps: | |
| - name: Generate timestamp tag | |
| id: settag | |
| run: | | |
| # Format: YYYYMMDDHHMMSS in UTC | |
| TAG=$(date -u +"%Y%m%d%H%M%S") | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "Generated tag: $TAG" | |
| build-and-push-x86: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: [generate-tag] | |
| env: | |
| IMAGE_NAME: manga-ingest-with-upscaling | |
| REGISTRY: ghcr.io | |
| OWNER: ${{ github.repository_owner }} | |
| TAG: ${{ needs.generate-tag.outputs.tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: 'true' | |
| - name: Set owner to lowercase | |
| run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Cuda Docker image (AMD64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-amd64,${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest-dev-amd64 | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max | |
| build-and-push-cuda128-x86: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: [generate-tag] | |
| env: | |
| IMAGE_NAME: manga-ingest-with-upscaling | |
| REGISTRY: ghcr.io | |
| OWNER: ${{ github.repository_owner }} | |
| TAG: ${{ needs.generate-tag.outputs.tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: 'true' | |
| - name: Set owner to lowercase | |
| run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Cuda 12.8 Docker image (AMD64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: cuda128.Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-cuda-12.8-amd64,${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest-dev-cuda-12.8-amd64 | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max | |
| build-and-push-rocm-x86: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: [generate-tag] | |
| env: | |
| IMAGE_NAME: manga-ingest-with-upscaling | |
| REGISTRY: ghcr.io | |
| OWNER: lolle2000la | |
| TAG: ${{ needs.generate-tag.outputs.tag }} | |
| steps: | |
| - name: Maximize build space | |
| uses: easimon/maximize-build-space@v10 | |
| with: | |
| root-reserve-mb: 35000 | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: 'true' | |
| - name: Set owner to lowercase | |
| run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ROCm Docker image (AMD64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: rocm.Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-rocm,${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest-dev-rocm | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| build-and-push-xpu-x86: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: [generate-tag] | |
| env: | |
| IMAGE_NAME: manga-ingest-with-upscaling | |
| REGISTRY: ghcr.io | |
| OWNER: lolle2000la | |
| TAG: ${{ needs.generate-tag.outputs.tag }} | |
| steps: | |
| - name: Maximize build space | |
| uses: easimon/maximize-build-space@v10 | |
| with: | |
| root-reserve-mb: 35000 | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: 'true' | |
| - name: Set owner to lowercase | |
| run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Intel XPU Docker image (AMD64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: xpu.Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-xpu,${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest-dev-xpu | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| build-and-push-remote-only-x86: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: [generate-tag] | |
| env: | |
| IMAGE_NAME: manga-ingest-with-upscaling | |
| REGISTRY: ghcr.io | |
| OWNER: lolle2000la | |
| TAG: ${{ needs.generate-tag.outputs.tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: 'true' | |
| - name: Set owner to lowercase | |
| run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Remote-Only Docker image (AMD64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: remoteonly.Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-remote-only,${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest-dev-remote-only | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| create-manifest: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: [build-and-push-x86, build-and-push-cuda128-x86, build-and-push-rocm-x86, build-and-push-xpu-x86, build-and-push-remote-only-x86, generate-tag] | |
| env: | |
| IMAGE_NAME: manga-ingest-with-upscaling | |
| REGISTRY: ghcr.io | |
| OWNER: lolle2000la | |
| TAG: ${{ needs.generate-tag.outputs.tag }} | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest for main image | |
| run: | | |
| IMAGE="${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}" | |
| docker buildx imagetools create -t "$IMAGE:${{ env.TAG }}" -t "$IMAGE:latest-dev" \ | |
| "$IMAGE:${{ env.TAG }}-amd64" | |
| - name: Create and push multi-arch manifest for CUDA 12.8 image | |
| run: | | |
| IMAGE="${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}" | |
| docker buildx imagetools create -t "$IMAGE:${{ env.TAG }}-cuda-12.8" -t "$IMAGE:latest-dev-cuda-12.8" \ | |
| "$IMAGE:${{ env.TAG }}-cuda-12.8-amd64" | |
| - name: Create and push multi-arch manifest for XPU image | |
| run: | | |
| IMAGE="${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}" | |
| docker buildx imagetools create -t "$IMAGE:${{ env.TAG }}-xpu" -t "$IMAGE:latest-dev-xpu" \ | |
| "$IMAGE:${{ env.TAG }}-xpu" |