|
39 | 39 | file: Dockerfile
|
40 | 40 | push: true
|
41 | 41 | tags: scrolltech/l2geth:${{inputs.tag}}-arm64
|
| 42 | + - name: Build arm64 image |
| 43 | + run: | |
| 44 | + docker build . --platform linux/arm64/v8 -t scrolltech/l2geth:${{inputs.tag}}-arm64 . |
| 45 | + docker push scrolltech/l2geth:${{inputs.tag}}-arm64 |
| 46 | +
|
| 47 | + build-and-push-amd64-image: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - name: Checkout code |
| 51 | + uses: actions/checkout@v2 |
| 52 | + - name: Set up QEMU |
| 53 | + uses: docker/setup-qemu-action@v2 |
| 54 | + - name: Set up Docker Buildx |
| 55 | + uses: docker/setup-buildx-action@v2 |
| 56 | + - name: Extract docker metadata |
| 57 | + id: meta |
| 58 | + uses: docker/metadata-action@v3 |
| 59 | + with: |
| 60 | + images: scrolltech/l2geth |
| 61 | + tags: | |
| 62 | + type=ref,event=tag,enable=${{ github.event_name == 'push' }} |
| 63 | + type=raw,value=latest,enable=${{ github.event_name == 'release' }} |
| 64 | + flavor: | |
| 65 | + latest=false |
| 66 | + - name: Login to Docker Hub |
| 67 | + uses: docker/login-action@v2 |
| 68 | + with: |
| 69 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 70 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 71 | +# - name: Build docker image |
| 72 | +# uses: docker/build-push-action@v2 |
| 73 | +# with: |
| 74 | +# context: . |
| 75 | +# file: Dockerfile |
| 76 | +# push: true |
| 77 | +# tags: scrolltech/l2geth:${{inputs.tag}}-amd64 |
| 78 | + |
| 79 | + - name: Build amd64 image |
| 80 | + run: | |
| 81 | + docker build . --platform linux/amd64 -t scrolltech/l2geth:${{inputs.tag}}-amd64 . |
| 82 | + docker push scrolltech/l2geth:${{inputs.tag}}-amd64 |
| 83 | +
|
| 84 | + publish-multi-arch-image: |
| 85 | + runs-on: ubuntu-latest |
| 86 | + needs: |
| 87 | + - build-and-push-amd64-image |
| 88 | + - build-and-push-arm64-image |
| 89 | + steps: |
| 90 | + - name: Checkout code |
| 91 | + uses: actions/checkout@v2 |
| 92 | + - name: Set up Docker Buildx |
| 93 | + uses: docker/setup-buildx-action@v2 |
| 94 | + - name: Extract docker metadata |
| 95 | + id: meta |
| 96 | + uses: docker/metadata-action@v3 |
| 97 | + with: |
| 98 | + images: scrolltech/l2geth |
| 99 | + tags: | |
| 100 | + type=ref,event=tag,enable=${{ github.event_name == 'push' }} |
| 101 | + type=raw,value=latest,enable=${{ github.event_name == 'release' }} |
| 102 | + flavor: | |
| 103 | + latest=false |
| 104 | + - name: Login to Docker Hub |
| 105 | + uses: docker/login-action@v2 |
| 106 | + with: |
| 107 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 108 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 109 | + - name: Build multiarch image |
| 110 | + run: | |
| 111 | + docker manifest create scrolltech/l2geth:${image_multiarch_name} --amend scrolltech/l2geth:${image_amd64_name} --amend scrolltech/l2geth:${image_arm64_name} && \ |
| 112 | + docker manifest push scrolltech/l2geth:${image_multiarch_name} |
| 113 | + env: |
| 114 | + image_arm64_name: "${{inputs.tag}}-arm64" |
| 115 | + image_amd64_name: "${{inputs.tag}}-amd64" |
| 116 | + image_multiarch_name: "${{inputs.tag}}-multiarch" |
0 commit comments