From 04a337fed2926aa1b014c7a92e272643b82de3cd Mon Sep 17 00:00:00 2001 From: Matty Evans Date: Wed, 11 Dec 2024 12:35:36 +1000 Subject: [PATCH] feat: Add Docker image build and push steps for versioning --- .github/workflows/release.yml | 7 +++++++ .goreleaser.yaml | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8fed61..3a4db57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + packages: write jobs: goreleaser: @@ -22,6 +23,12 @@ jobs: with: go-version: '1.21' + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fa6a928..7d36137 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,6 +16,16 @@ builds: - amd64 - arm64 +dockers: + - image_templates: + - "ethpandaops/contributoor-test:{{ .Version }}" + - "ethpandaops/contributoor-test:latest" + dockerfile: Dockerfile + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.version={{.Version}}" + archives: - format: tar.gz name_template: >-