From dc6ff036b148637012cbb05a125b3d6e94653e16 Mon Sep 17 00:00:00 2001 From: Fu Zi Xiang Date: Wed, 27 Dec 2023 05:15:40 +0800 Subject: [PATCH] feat: support arm build --- .github/workflows/push_latest_docker.yml | 25 ++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/push_latest_docker.yml b/.github/workflows/push_latest_docker.yml index 904f7e359..43433dcd4 100644 --- a/.github/workflows/push_latest_docker.yml +++ b/.github/workflows/push_latest_docker.yml @@ -20,19 +20,32 @@ env: jobs: gotrue_image: runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - arch: amd64 + - arch: arm64 steps: - name: Check out the repository uses: actions/checkout@v3 + - name: Set up QEMU + if: matrix.arch == 'arm64' + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Build and Push GoTrue run: | export TAG=${GITHUB_REF#refs/*/} - docker compose build gotrue - docker tag appflowy-cloud-gotrue appflowyinc/gotrue:$TAG - echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login --username appflowyinc --password-stdin - docker push appflowyinc/gotrue:$TAG - docker tag appflowy-cloud-gotrue appflowyinc/gotrue:latest - docker push appflowyinc/gotrue:latest + docker buildx build --platform linux/${{ matrix.arch }} -t appflowyinc/gotrue:${TAG} -t appflowyinc/gotrue:latest --push . appflowy_cloud_image: runs-on: ubuntu-22.04