diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000000..3131b3dbcfc4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,44 @@ +name: docker_publish + +on: + pull_request: + branches: + - 'feat/babylon-rfc' + push: + tags: + - 'v*' + +jobs: + docker_pipeline: + runs-on: ubuntu-24.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get the version + id: get_version + run: | + if [[ $GITHUB_REF == refs/pull/* ]]; then + echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + elif [[ $GITHUB_REF == refs/tags/* ]]; then + echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + fi + + - name: Build and push to Docker Hub + id: build-dockerhub + uses: docker/build-push-action@v6 + with: + push: true + file: ./ops/docker/op-stack-go/Dockerfile + target: op-node-target + outputs: type=image,name=${{ vars.DOCKERHUB_REGISTRY_ID }}/op-node-babylon-finality-gadget:${{ steps.get_version.outputs.VERSION }} + diff --git a/ops/docker/op-stack-go/Dockerfile b/ops/docker/op-stack-go/Dockerfile index 18163a86c3cc..d40501ee57c4 100644 --- a/ops/docker/op-stack-go/Dockerfile +++ b/ops/docker/op-stack-go/Dockerfile @@ -7,10 +7,10 @@ # All target images use this as base image, and add the final build results. # It will default to the target platform. -ARG TARGET_BASE_IMAGE=alpine:3.18 +ARG TARGET_BASE_IMAGE=alpine:3.20 # We may be cross-building for another platform. Specify which platform we need as builder. -FROM --platform=$BUILDPLATFORM golang:1.21.3-alpine3.18 AS builder +FROM --platform=$BUILDPLATFORM golang:1.22.8-alpine3.20 AS builder RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash