Skip to content

Commit

Permalink
chore: add docker build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe Valente committed Aug 8, 2023
1 parent 6fe0efd commit ce189df
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: docker-prysm

on:
push:
paths:
- '.github/workflows/docker.yml'
- 'Dockerfile'
branches:
- '**'
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
build-ref:
description: 'The git ref to build from'
type: string
default: ''
required: false

env:
REGISTRY_IMAGE_PREFIX: ghcr.io/polymerdao/prysm

jobs:
build:
runs-on: ubuntu-22.04-16core
strategy:
fail-fast: true
matrix:
binary:
- beacon-chain
- prysmctl
- validator
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.build-ref }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY_IMAGE_PREFIX }}-${{ matrix.binary }}
tags: |
type=sha
type=semver,pattern={{raw}}
labels: |
org.opencontainers.image.source=https://github.com/polymerdao/ibc-sdk
org.opencontainers.image.title=prysm
org.opencontainers.image.url=https://github.com/polymerdao/ibc-sdk
- name: Authenticate Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PACKAGES_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
env:
REGISTRY_IMAGE: ${{ env.REGISTRY_IMAGE_PREFIX }}-${{ matrix.binary }}
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BINARY=${{ matrix.binary }}
# TODO: these cause the runner to hang and crash
# cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache
# cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache,mode=max

0 comments on commit ce189df

Please sign in to comment.