mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-07-17 13:20:17 +00:00
Build target-specific nextest archives once and reuse each extraction across four host workers. Pin prebuilt tools and RISC Zero components, reduce duplicate cache writes, and preserve coverage checks.
99 lines
3.7 KiB
YAML
99 lines
3.7 KiB
YAML
name: Publish Docker Images
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
# Shared base (toolchain + r0vm), single source of truth in
|
|
# lez/docker/risc0-base.Dockerfile. Built and pushed once so the service
|
|
# builds below can pull it as the `risc0_base` named context. The
|
|
# docker-container builder resolves named contexts from the registry (not the
|
|
# host image store), so the base must be pushed, not just loaded.
|
|
risc0_base:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
with:
|
|
registry: ${{ secrets.DOCKER_REGISTRY }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push risc0 base image
|
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
|
|
with:
|
|
context: .
|
|
file: ./lez/docker/risc0-base.Dockerfile
|
|
push: true
|
|
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }}/risc0_base:sha-${{ github.sha }}
|
|
cache-from: type=gha,scope=risc0-base
|
|
cache-to: type=gha,mode=max,scope=risc0-base
|
|
|
|
publish:
|
|
needs: risc0_base
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: sequencer_service
|
|
dockerfile: ./lez/sequencer/service/Dockerfile
|
|
build_args: |
|
|
STANDALONE=false
|
|
- name: sequencer_service-standalone
|
|
dockerfile: ./lez/sequencer/service/Dockerfile
|
|
build_args: |
|
|
STANDALONE=true
|
|
- name: indexer_service
|
|
dockerfile: ./lez/indexer/service/Dockerfile
|
|
build_args: ""
|
|
- name: explorer_service
|
|
dockerfile: ./lez/explorer_service/Dockerfile
|
|
build_args: ""
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
with:
|
|
registry: ${{ secrets.DOCKER_REGISTRY }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
|
|
with:
|
|
images: ${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }}/${{ matrix.name }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=sha,prefix=sha-
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
|
|
with:
|
|
context: .
|
|
file: ${{ matrix.dockerfile }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: ${{ matrix.build_args }}
|
|
build-contexts: risc0_base=docker-image://${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }}/risc0_base:sha-${{ github.sha }}
|
|
cache-from: type=gha,scope=${{ matrix.name }}
|
|
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
|