diff --git a/.github/workflows/docker-reusable.yml b/.github/workflows/docker-reusable.yml index 7d937f78..95702911 100644 --- a/.github/workflows/docker-reusable.yml +++ b/.github/workflows/docker-reusable.yml @@ -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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fb97c339..6e4929e3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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