Skip to content

docker-git

docker-git #8

Workflow file for this run

# Publishes the Docker image, only to be used with `workflow_dispatch`. The
# images from this workflow will be tagged with the git sha of the branch used
# and will NOT tag it as `latest`.
name: docker-git
on:
workflow_dispatch: {}
env:
REPO_NAME: ${{ github.repository_owner }}/reth
CARGO_TERM_COLOR: always
DOCKER_USERNAME: ${{ github.actor }}
GIT_SHA: ${{ github.sha }}
jobs:
build:
name: build and push
runs-on: ubuntu-20.04
permissions:
packages: write
contents: read
strategy:
matrix:
image-name:
- reth
- op-reth
include:
- image-name: reth
docker_image_name: ghcr.io/${{ github.repository_owner }}/reth
make_target: docker-build-push-git-sha
- image-name: op-reth
docker_image_name: ghcr.io/${{ github.repository_owner }}/op-reth
make_target: op-docker-build-push-git-sha
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
key: ${{ matrix.image-name }}
- uses: taiki-e/install-action@cross
- name: Log in to Docker
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin
- name: Set up Docker builder
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
docker buildx create --use --name cross-builder
- name: Build and push the git-sha-tagged ${{ matrix.image-name }} image
run: |
CI=true make IMAGE_NAME=${{ matrix.image-name }} DOCKER_IMAGE_NAME=${{ matrix.docker_image_name }} GIT_SHA=$GIT_SHA PROFILE=maxperf ${{ matrix.make_target }}