Skip to content

chore(protocol-contracts): improve staking tasks (#1776) #5994

chore(protocol-contracts): improve staking tasks (#1776)

chore(protocol-contracts): improve staking tasks (#1776) #5994

name: host-contracts-docker-build
on:
workflow_call:
secrets:
AWS_ACCESS_KEY_S3_USER:
required: true
AWS_SECRET_KEY_S3_USER:
required: true
BLOCKCHAIN_ACTIONS_TOKEN:
required: true
CGR_USERNAME:
required: true
CGR_PASSWORD:
required: true
outputs:
build_result:
description: "Result of the build job of this workflow"
value: ${{ jobs.build.result }}
release:
types:
- published
workflow_dispatch:
push:
branches:
- main
permissions: {}
concurrency:
group: host-contracts-docker-build-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check-changes:
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
changes-host-contracts: ${{ steps.filter.outputs.host-contracts }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
host-contracts:
- .github/workflows/host-contracts-docker-build.yml
- host-contracts/**
build:
needs: check-changes
if: |
needs.check-changes.outputs.changes-host-contracts == 'true'
|| github.event_name == 'release'
|| github.event_name == 'workflow_dispatch'
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@3cf4c2b133947d29e7a313555638621f9ca0345c # v1.0.3
secrets:
AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }}
AWS_SECRET_KEY_S3_USER: ${{ secrets.AWS_SECRET_KEY_S3_USER }}
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
CGR_USERNAME: ${{ secrets.CGR_USERNAME }}
CGR_PASSWORD: ${{ secrets.CGR_PASSWORD }}
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
attestations: 'write' # Required to create build attestations
packages: 'write' # Required to publish Docker images
id-token: 'write' # Required for OIDC authentication
with:
working-directory: "."
docker-context: "."
push_image: true
image-name: "fhevm/host-contracts"
docker-file: "./host-contracts/Dockerfile"
app-cache-dir: "fhevm-host-contracts"
re-tag-image:
needs: check-changes
if: |
needs.check-changes.outputs.changes-host-contracts != 'true' && github.event_name == 'push'
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
packages: 'write' # Required to publish Docker images
id-token: 'write' # Required for OIDC authentication
uses: ./.github/workflows/re-tag-docker-image.yml
with:
image-name: "fhevm/host-contracts"
previous-tag-or-commit: ${{ github.event.before }}
new-tag-or-commit: ${{ github.event.after }}