Skip to content

Build prysm docker image #209

Build prysm docker image

Build prysm docker image #209

name: Build prysm docker image
on:
workflow_dispatch:
inputs:
repository:
description: The source prysm repository to build from
default: prysmaticlabs/prysm
type: string
required: true
ref:
description: The branch, tag or SHA to checkout and build from
default: develop
type: string
required: true
docker_tag:
description: Override target docker tag (defaults to the above source ref if left blank)
type: string
required: false
build_method:
description: Build method to use (go or bazel)
type: choice
options:
- bazel
- go
default: go
required: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
platforms: ${{ steps.setup.outputs.platforms }}
target_tag: ${{ steps.tag.outputs.docker_tag }}
steps:
- uses: actions/checkout@v4
- name: Prepare Matrix
id: setup
uses: ./.github/actions/prepare
with:
client: 'prysm-beacon-chain'
- name: Generate target tag
id: tag
uses: ./.github/actions/docker-tag
with:
input: ${{ inputs.docker_tag || inputs.ref }}
deploy-beacon:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
with:
repository: ${{ inputs.repository }}
- uses: ./.github/actions/deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
build_script: ./prysm/build_beacon.sh
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
target_repository: ethpandaops/prysm-beacon-chain
target_dockerfile: ./prysm/Dockerfile.beacon
platform: ${{ matrix.platform }}
build_method: ${{ inputs.build_method }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
deploy-beacon-minimal:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
with:
repository: ${{ inputs.repository }}
- uses: ./.github/actions/deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
build_script: ./prysm/build_beacon_minimal.sh
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal-${{ matrix.slug }}
target_repository: ethpandaops/prysm-beacon-chain
target_dockerfile: ./prysm/Dockerfile.beacon
platform: ${{ matrix.platform }}
build_method: ${{ inputs.build_method }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
deploy-validator:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
with:
repository: ${{ inputs.repository }}
- uses: ./.github/actions/deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
build_script: ./prysm/build_validator.sh
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
target_repository: ethpandaops/prysm-validator
target_dockerfile: ./prysm/Dockerfile.validator
platform: ${{ matrix.platform }}
build_method: ${{ inputs.build_method }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
deploy-validator-minimal:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
with:
repository: ${{ inputs.repository }}
- uses: ./.github/actions/deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
build_script: ./prysm/build_validator_minimal.sh
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal-${{ matrix.slug }}
target_repository: ethpandaops/prysm-validator
target_dockerfile: ./prysm/Dockerfile.validator
platform: ${{ matrix.platform }}
build_method: ${{ inputs.build_method }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
manifest-beacon:
needs:
- prepare
- deploy-beacon
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}
target_repository: ethpandaops/prysm-beacon-chain
platforms: ${{ needs.prepare.outputs.platforms }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
manifest-beacon-minimal:
needs:
- prepare
- deploy-beacon-minimal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal
target_repository: ethpandaops/prysm-beacon-chain
platforms: ${{ needs.prepare.outputs.platforms }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
manifest-validator:
needs:
- prepare
- deploy-validator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}
target_repository: ethpandaops/prysm-validator
platforms: ${{ needs.prepare.outputs.platforms }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
manifest-validator-minimal:
needs:
- prepare
- deploy-validator-minimal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal
target_repository: ethpandaops/prysm-validator
platforms: ${{ needs.prepare.outputs.platforms }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
notify:
name: Discord Notification
runs-on: ubuntu-latest
needs:
- prepare
- deploy-beacon
- deploy-beacon-minimal
- deploy-validator
- deploy-validator-minimal
- manifest-beacon
- manifest-beacon-minimal
- manifest-validator
- manifest-validator-minimal
if: failure()
steps:
- name: Notify
uses: nobrayner/discord-webhook@v1
with:
github-token: ${{ secrets.github_token }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}