From cf723e0e289c5b1f91980e837daefaa6c07742d3 Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Fri, 8 Mar 2024 16:26:30 +1300 Subject: [PATCH] Get docker image CI working --- .github/workflows/release.yml | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9fad91c86df..85371ef8b172 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,12 @@ name: "Publish Docker" on: - workflow_dispatch: - inputs: - isLatest: - description: 'Add latest tag' - default: 'true' - required: true + push: + tags: + - '*' # Push events to every tag jobs: publish: runs-on: ubuntu-latest - env: - DOCKER_HUB_USERNAME: subquerynetwork - DOCKRE_HUB_PASSWORD: ${{ secrets.SQ_DOCKERHUB_TOKEN }} - DOCKER_CLI_EXPERIMENTAL: enabled steps: - uses: actions/checkout@v2 - name: Set up Go @@ -21,15 +14,31 @@ jobs: with: go-version: 1.21.4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: subquerynetwork - password: ${{ secrets.DOCKERHUB_TOKEN }} + password: ${{ secrets.SQ_DOCKERHUB_TOKEN }} - name: Build Docker run: go run build/ci.go docker -image -manifest amd64,arm64 -upload subquerynetwork/geth + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: arm64,amd64 + file: Dockerfile + # TODO bring back latest + tags: subquerynetwork/geth-client:${{ github.ref_name }} + build-args: | + COMMIT=${{github.sha}} + VERSION=${{github.ref_name}} + BUILDNUM=${{github.run_number}}