Build #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
geth_version: | |
description: Geth Version | |
required: true | |
jobs: | |
build: | |
runs-on: foam-internal | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Docker Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: "arm,arm64" | |
- name: Docker Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: "linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v8" | |
- name: Log in to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/arm/v7,linux/arm64/v8,linux/amd64 | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cliquebait:${{ github.event.inputs.geth_version }} | |
build-args: GETH_VERSION=${{ github.event.inputs.geth_version }} | |
- name: Load amd64 into docker for local testing | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64 | |
load: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cliquebait:${{ github.event.inputs.geth_version }} | |
build-args: GETH_VERSION=${{ github.event.inputs.geth_version }} | |
- name: Ensure it runs | |
timeout-minutes: 2 | |
run: | | |
docker run --rm -d -p 8545:8545 -e ACCOUNTS_TO_CREATE=10 ${{ secrets.DOCKERHUB_USERNAME }}/cliquebait:${{ github.event.inputs.geth_version }} | |
until curl http://localhost:8545 ; do sleep 1; done | |
- name: Push image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/arm/v7,linux/arm64/v8,linux/amd64 | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cliquebait:${{ github.event.inputs.geth_version }} | |
build-args: GETH_VERSION=${{ github.event.inputs.geth_version }} | |