diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3cb48cede..b8c33c973 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -83,12 +83,27 @@ jobs: docker image ls docker system df build-node: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + platform: [linux/amd64] + include: + - name: identity-service + os: ubuntu-latest + platform: linux/amd64 + - name: credential-schema + os: ubuntu-latest + platform: linux/amd64 + - name: credentials-service + os: ubuntu-latest + platform: linux/amd64 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Setup containerd driver type run: | echo '{ "features": { "containerd-snapshotter": true } }' | sudo tee /etc/docker/daemon.json + export BUILDX_EXPERIMENTAL=1 sudo systemctl restart docker docker info -f '{{ .DriverStatus }}' docker info @@ -107,14 +122,15 @@ jobs: uses: actions/cache@v4 with: path: /tmp/docker-layer-cache - key: ${{ runner.os }}-docker-cache-node + key: ${{ runner.os }}-docker-cache-node-${{ matrix.name }} restore-keys: | - ${{ runner.os }}-docker-cache-node + ${{ runner.os }}-docker-cache-node-${{ matrix.name }} - name: Build Node Services env: CACHE_SRC: type=local,src=/tmp/docker-layer-cache CACHE_DST: type=local,dest=/tmp/docker-layer-cache - run: make build-node + PLATFORM: ${{ matrix.platform }} + run: make -C services/${{ matrix.name }}/ docker - name: Publish build artifacts run: make publish-builds - name: Check space after tests diff --git a/services/credential-schema/Makefile b/services/credential-schema/Makefile index 52bb85cfa..9e0e9fb6f 100644 --- a/services/credential-schema/Makefile +++ b/services/credential-schema/Makefile @@ -3,7 +3,7 @@ IMAGE:=local/sunbird-rc-credential-schema .PHONY: docker publish test docker: - @docker build --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . + @docker buildx build --platform=$$PLATFORM --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . publish: @docker push $(IMAGE) diff --git a/services/credentials-service/Makefile b/services/credentials-service/Makefile index bbcfadebc..d5df95073 100644 --- a/services/credentials-service/Makefile +++ b/services/credentials-service/Makefile @@ -2,7 +2,7 @@ IMAGE:=local/sunbird-rc-credentials-service .PHONY: docker publish test docker: - @docker build --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . + @docker buildx build --platform=$$PLATFORM --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . publish: @docker push $(IMAGE) test: diff --git a/services/identity-service/Makefile b/services/identity-service/Makefile index 0598686fe..305f3d02b 100644 --- a/services/identity-service/Makefile +++ b/services/identity-service/Makefile @@ -3,7 +3,7 @@ IMAGE:=local/sunbird-rc-identity-service .PHONY: docker publish test run unseal docker: - @docker build --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . + @docker buildx build --platform=$$PLATFORM --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . publish: @docker push $(IMAGE) test: