diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml index 0dc9a27e..619cd8b8 100644 --- a/.github/workflows/dockerize.yml +++ b/.github/workflows/dockerize.yml @@ -38,13 +38,16 @@ env: jobs: build: name: Publish Khoj Docker Images - runs-on: ubuntu-linux-x64-high strategy: fail-fast: false matrix: image: - 'local' - 'cloud' + platform: + - linux/amd64 + - linux/arm64 + runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-linux-arm64' || 'ubuntu-latest' }} steps: - name: Checkout Code uses: actions/checkout@v3 @@ -78,7 +81,7 @@ jobs: with: context: . file: Dockerfile - platforms: linux/amd64, linux/arm64 + platforms: ${{ matrix.platform }} push: true tags: | ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} @@ -86,8 +89,8 @@ jobs: build-args: | VERSION=${{ steps.hatch.outputs.version }} PORT=42110 - cache-from: type=gha,scope=${{ matrix.image }} - cache-to: type=gha,mode=max,scope=${{ matrix.image }} + cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.platform }} + cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.platform}} - name: 📦️⛅️ Build and Push Cloud Docker Image uses: docker/build-push-action@v4 @@ -95,7 +98,7 @@ jobs: with: context: . file: prod.Dockerfile - platforms: linux/amd64, linux/arm64 + platforms: ${{ matrix.platform }} push: true tags: | ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} @@ -103,5 +106,5 @@ jobs: build-args: | VERSION=${{ steps.hatch.outputs.version }} PORT=42110 - cache-from: type=gha,scope=${{ matrix.image }} - cache-to: type=gha,mode=max,scope=${{ matrix.image }} + cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.platform }} + cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.platform}}