From d249140100b38754f469907aaf01bb1aa2fecc56 Mon Sep 17 00:00:00 2001 From: frantuma Date: Tue, 28 Nov 2023 12:34:26 +0100 Subject: [PATCH] multi platform docker images for releases --- .github/workflows/docker-release-master.yml | 34 ++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker-release-master.yml b/.github/workflows/docker-release-master.yml index 00c1f09d250..81fd72127d7 100644 --- a/.github/workflows/docker-release-master.yml +++ b/.github/workflows/docker-release-master.yml @@ -23,6 +23,10 @@ jobs: java-version: 17 distribution: temurin cache: maven + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: preliminary checks run: | docker login --username=${{ secrets.DOCKERHUB_SB_USERNAME }} --password=${{ secrets.DOCKERHUB_SB_PASSWORD }} @@ -50,20 +54,22 @@ jobs: - name: Build with Maven run: | mvn clean install -U - - name: docker build and push - run: | - export DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator - export DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - - docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME:${{ env.TAG }} ./modules/swagger-generator - docker tag $DOCKER_GENERATOR_IMAGE_NAME:${{ env.TAG }} $DOCKER_GENERATOR_IMAGE_NAME:latest - docker push $DOCKER_GENERATOR_IMAGE_NAME:${{ env.TAG }} - docker push $DOCKER_GENERATOR_IMAGE_NAME:latest - docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:${{ env.TAG }} ./modules/swagger-codegen-cli - docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:${{ env.TAG }} $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest - docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME:${{ env.TAG }} - docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest + - name: Build generator image and push + uses: docker/build-push-action@v5 + with: + context: ./modules/swagger-generator + push: true + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + provenance: false + tags: swaggerapi/swagger-generator:${{ env.TAG }},swaggerapi/swagger-generator:latest + - name: Build CLI image and push + uses: docker/build-push-action@v5 + with: + context: ./modules/swagger-codegen-cli + push: true + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + provenance: false + tags: swaggerapi/swagger-codegen-cli:${{ env.TAG }},swaggerapi/swagger-codegen-cli:latest - name: deploy run: | echo "${{ env.TAG }}"