From 985880745e7bb34454281474b6e39c55306e7c3a Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Wed, 19 Jun 2024 14:28:45 +0200 Subject: [PATCH] test build with macos and ubuntu arm64 --- .github/workflows/docker.yaml | 41 ++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 660fd29aef91..ef81d1f622f3 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -31,8 +31,9 @@ jobs: tags: scrolltech/l2geth:${{github.ref_name}}-amd64 # cache-from: type=gha,scope=${{ github.workflow }} # cache-to: type=gha,scope=${{ github.workflow }} - build-and-push-arm64-image: - runs-on: [self-hosted, Linux, ARM64, scroll-runner] + build-and-push-mac-runner: + #runs-on: [self-hosted, Linux, ARM64, scroll-runner] + runs-on: [macos-12] steps: - name: Checkout code uses: actions/checkout@v2 @@ -53,6 +54,40 @@ jobs: file: Dockerfile # push: ${{ startsWith(github.ref, 'refs/tags/') }} push: true - tags: scrolltech/l2geth:${{github.ref_name}}-arm64 + tags: scrolltech/l2geth:${{github.ref_name}}-arm64-macos # cache-from: type=gha,scope=${{ github.workflow }} # cache-to: type=gha,scope=${{ github.workflow }} + + build-and-push-arm64-ubuntu-runner: + runs-on: ubuntu-latest + strategy: + matrix: + arch: + - amd64 + - aarch64 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up QEMU + if: matrix.arch == 'aarch64' + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx create --name multiarch --driver docker-container --use + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build docker image + uses: docker/build-push-action@v2 + with: + platforms: linux/arm64 + context: . + file: Dockerfile + push: true + tags: scrolltech/l2geth:${{github.ref_name}}-arm64-ubuntu