diff --git a/.github/workflows/p2p_node_docker_build copy.yml b/.github/workflows/p2p_node_docker_build copy.yml new file mode 100644 index 00000000..50d1dc65 --- /dev/null +++ b/.github/workflows/p2p_node_docker_build copy.yml @@ -0,0 +1,102 @@ +name: "[Nethermind] Catalyst P2P Node - Docker build and push" + +on: + workflow_dispatch: + push: + branches: [master] + tags: + - "catalyst-p2p-node-v*" + paths: + - "tools/p2p_node/**" + +env: + DOCKER_REGISTRY: docker.io + DOCKER_IMAGE_NAME: preconf-p2p-node + DOCKER_REPOSITORY: nethermind + +jobs: + build: + name: Build and push temporary docker image + runs-on: ${{ matrix.os }} + if: github.repository == 'NethermindEth/Catalyst' + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux/amd64 + - os: ubuntu-24.04-arm + platform: linux/arm64 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }} + tags: type=raw,value=temp-${{ matrix.os }} + + - name: Build and push by digest + id: build + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64 + context: ./tools/p2p_node + file: ./tools/p2p_node/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + merge: + name: Merge and push docker image + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }} + tags: | + type=raw,value=latest + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + type=sha + + - name: Create manifest list and push + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:temp-ubuntu-latest \ + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:temp-ubuntu-24.04-arm + + - name: Summary + run: | + echo "## Docker build completed :green_circle:" >> $GITHUB_STEP_SUMMARY + echo "### Tags" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.meta.outputs.tags }}" | while IFS= read -r TAG; do + echo "- $TAG" >> $GITHUB_STEP_SUMMARY + done