1
0
Fork 0
forked from lthn/blockchain
blockchain/.github/workflows/build-docker.yml
Snider eadf6ebfec Refactor CI workflows and build process
Enable Conan package caching and remove redundant doc build steps from all platform workflows. Update Makefile to ensure docs are built as part of the release target. Clean up MSVC runtime variable logic in conanfile.py and adjust Docker workflow runner and build args.
2025-10-01 23:52:43 +01:00

69 lines
2.1 KiB
YAML

name: Docker
permissions:
contents: read
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
jobs:
build:
name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}"
runs-on: ubuntu-24.04
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: utils/docker/images/lthn-chain/Dockerfile
context: ${{ github.workspace }}
push: true
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
BUILD_THREADS=2
target: builder
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}
cache-from: type=registry,ref=lthn/chain:buildcache
cache-to: type=registry,ref=lthn/chain:buildcache,mode=max
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
file: utils/docker/images/lthn-chain/Dockerfile
context: ${{ github.workspace }}
push: true
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
BUILD_THREADS=2
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}
cache-from: type=registry,ref=lthn/chain:buildcache