Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ jobs:
needs: [prinfo]
if: ${{ needs.prinfo.outputs.build_docker == 'true' }}
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write # push to ghcr.io/ethpandaops
id-token: write # attest, and authenticate to the image mirror
attestations: write
env:
DOCKER_REPOSITORY: ethpandaops/checkpointz
DOCKER_REPOSITORY: ghcr.io/ethpandaops/checkpointz
DOCKER_TAG: ${{ needs.prinfo.outputs.docker_tag }}
steps:
- name: Checkout
Expand Down Expand Up @@ -117,12 +122,14 @@ jobs:
done
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Login to DockerHub
- name: Login to GHCR
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push docker image
id: build
run: |
# The release Dockerfile only copies the prebuilt binary, so both platforms
# build without emulation.
Expand All @@ -134,4 +141,13 @@ jobs:
--label "org.opencontainers.image.version=$DOCKER_TAG" \
--tag "$DOCKER_REPOSITORY:$DOCKER_TAG" \
--tag "$DOCKER_REPOSITORY:$DOCKER_TAG-$SHA_SHORT" \
--metadata-file "$RUNNER_TEMP/build-metadata.json" \
--push

echo "digest=$(jq -r '."containerimage.digest"' "$RUNNER_TEMP/build-metadata.json")" >> "$GITHUB_OUTPUT"
- name: Attest and mirror to Docker Hub
uses: ethpandaops/actions/mirror-image@738aeadbcdc54f1c9af659d35f8ef29dd5c0fae6
with:
tags: ${{ env.DOCKER_TAG }} ${{ env.DOCKER_TAG }}-${{ env.SHA_SHORT }}
digest: ${{ steps.build.outputs.digest }}
mirror-url: ${{ secrets.IMAGE_MIRROR_URL }}
43 changes: 36 additions & 7 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ on:
jobs:
goreleaser:
permissions:
contents: write
runs-on:
- self-hosted-ghr
- size-l-x64
contents: write # GitHub release
packages: write # push to ghcr.io/ethpandaops
id-token: write # attest, and authenticate to the image mirror
attestations: write
runs-on: ubuntu-latest
outputs:
image: ${{ steps.attest.outputs.image }}
digests: ${{ steps.attest.outputs.digests }}
steps:
-
name: Checkout
Expand Down Expand Up @@ -62,11 +66,12 @@ jobs:
with:
endpoint: builders
-
name: Login to DockerHub
name: Login to GHCR
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Update GoReleaser config
run: |
cp .goreleaser.yaml ../.goreleaser.yaml.new
Expand All @@ -87,3 +92,27 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_SUFFIX: ${{ env.RELEASE_SUFFIX }}
- name: Attest images
id: attest
uses: ethpandaops/actions/mirror-image@738aeadbcdc54f1c9af659d35f8ef29dd5c0fae6
with:
goreleaser-artifacts: dist/artifacts.json
mirror: "false"

# Separate job, so "Re-run failed jobs" retries only the mirror and never
# rebuilds the images.
mirror:
needs: goreleaser
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
id-token: write # authenticate to the image mirror
steps:
- name: Mirror to Docker Hub
uses: ethpandaops/actions/mirror-image@738aeadbcdc54f1c9af659d35f8ef29dd5c0fae6
with:
image: ${{ needs.goreleaser.outputs.image }}
tags: ${{ needs.goreleaser.outputs.digests }}
attest: "false"
mirror-url: ${{ secrets.IMAGE_MIRROR_URL }}
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dockers_v2:
- id: scratch
dockerfile: goreleaser-scratch.Dockerfile
images:
- "ethpandaops/{{ .ProjectName }}"
- "ghcr.io/ethpandaops/{{ .ProjectName }}"
tags:
- "{{ .Version }}"
- "{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest"
Expand All @@ -60,7 +60,7 @@ dockers_v2:
- id: debian
dockerfile: goreleaser-debian.Dockerfile
images:
- "ethpandaops/{{ .ProjectName }}"
- "ghcr.io/ethpandaops/{{ .ProjectName }}"
tags:
- "{{ .Version }}-debian"
- "{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest"
Expand Down
Loading