ci: add compatible contracts image for nim-codex docker image

This commit is contained in:
Adam Uhlíř 2025-04-03 10:57:59 +02:00
parent 4e2a321ad5
commit ce606a5a27
2 changed files with 23 additions and 0 deletions

View File

@ -59,6 +59,10 @@ on:
required: false
type: string
default: false
contract_image:
description: Specifies compatible smart contract image
required: false
type: string
env:
@ -71,6 +75,7 @@ env:
TAG_LATEST: ${{ inputs.tag_latest }}
TAG_SHA: ${{ inputs.tag_sha }}
TAG_SUFFIX: ${{ inputs.tag_suffix }}
CONTRACT_IMAGE: ${{ inputs.contract_image }}
# Tests
TESTS_SOURCE: codex-storage/cs-codex-dist-tests
TESTS_BRANCH: master
@ -183,6 +188,11 @@ jobs:
else
echo "TAG_RAW=false" >>$GITHUB_ENV
fi
# Create contract label for compatible contract image if specified
if [[ -n "${{ env.CONTRACT_IMAGE }}" ]]; then
echo "CONTRACT_LABEL=storage.codex.nim-codex.blockchain-image=${{ env.CONTRACT_IMAGE }}" >>$GITHUB_ENV
fi
- name: Docker - Download digests
uses: actions/download-artifact@v4
@ -199,6 +209,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REPO }}
labels: ${{ env.CONTRACT_LABEL }}
flavor: |
latest=${{ env.TAG_LATEST }}
suffix=${{ env.TAG_SUFFIX }},onlatest=true

View File

@ -20,9 +20,21 @@ on:
jobs:
build-contracts-and-push:
name: Build and Push Codex Contracts
uses: codex-storage/github-actions/.github/workflows/docker-reusable.yml@master
with:
docker_build_context: vendor/codex-contracts-eth
docker_file: vendor/codex-contracts-eth/docker/Dockerfile
dockerhub_repo: codexstorage/codex-contracts-eth
tag_suffix: -codex-factory
tag_sha_long: true
secrets: inherit
build-and-push:
name: Build and Push
uses: ./.github/workflows/docker-reusable.yml
with:
tag_latest: ${{ github.ref_name == github.event.repository.default_branch || startsWith(github.ref, 'refs/tags/') }}
contract_image: "codexstorage/codex-contracts-eth:${{ github.sha }}-codex-factory"
secrets: inherit