From 5a2c60e5d1cc7e44d0e2caad933ee3349bb0d593 Mon Sep 17 00:00:00 2001 From: salmannawaz Date: Fri, 9 Feb 2024 00:36:06 +0500 Subject: [PATCH] Docker multi-arch images push for linux/amd64, linux/arm64 (#4018) * build: update github action for multi-arch docker images * build: update github action for multi-arch docker images * fix: test for docker multi-arch image push * fix: test for docker multi-arch image push * fix: test for docker multi-arch image push * fix: test for docker multi-arch image push * fix: test for docker multi-arch image push * fix: test for docker multi-arch image push * fix: docker multi-arch images * fix: docker multi-arch images --------- Co-authored-by: Salman Nawaz Co-authored-by: Feanil Patel --- .github/workflows/docker-publish.yml | 29 +++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f7a909afa8..65accf6058 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,24 +27,39 @@ jobs: return tagName; result-encoding: string + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build and push Dev Docker image - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v4 with: push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} target: dev repository: edxops/discovery-dev - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + tags: | + edxops/discovery-dev:${{ steps.get-tag-name.outputs.result }} + edxops/discovery-dev:${{ github.sha }} + platforms: linux/amd64,linux/arm64 # The current priority is to get the devstack off of Ansible based Images. Once that is done, we can come back to this part to get # suitable images for smaller prod environments. # - name: Build and push prod Docker image - # uses: docker/build-push-action@v1 + # uses: docker/build-push-action@v4 # with: # push: true - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_PASSWORD }} # target: prod # repository: edxops/discovery-prod # tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + # tags: | + # edxops/discovery-prod:${{ steps.get-tag-name.outputs.result }} + # edxops/discovery-prod:${{ github.sha }} + # platforms: linux/amd64,linux/arm64