Skip to content

Commit

Permalink
multi platform docker images for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Nov 28, 2023
1 parent 6273638 commit d249140
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/docker-release-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}"
Expand Down

0 comments on commit d249140

Please sign in to comment.