diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000000..a255148c2ef3 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,73 @@ +name: Docker Image + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag' + required: true + release: + types: [created] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + VERSION: ${{ github.event.inputs.tag || github.event.release.tag_name || '' }} + +jobs: + build-and-push: + runs-on: k8s-infrastructure-dind + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Check if VERSION follows the x.x.x format + run: | + if [[ "${{ env.VERSION }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "LATEST_TAG_ENABLED=true" >> $GITHUB_ENV + else + echo "LATEST_TAG_ENABLED=false" >> $GITHUB_ENV + fi + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=semver,pattern={{version}},value=${{ env.VERSION }} + type=raw,value=latest,enable=${{ env.LATEST_TAG_ENABLED == 'true' }} + type=raw,value=testnet + flavor: | + latest=false + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + VERSION=${{ env.VERSION }} diff --git a/.github/workflows/release-arbitrum.yml b/.github/workflows/release-arbitrum.yml index 8f437f92da0a..ef7f19a2b5d5 100644 --- a/.github/workflows/release-arbitrum.yml +++ b/.github/workflows/release-arbitrum.yml @@ -2,8 +2,8 @@ name: Release for Arbitrum on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-blackfort.yml b/.github/workflows/release-blackfort.yml index 01d7ffaa78df..baaa09c92ecf 100644 --- a/.github/workflows/release-blackfort.yml +++ b/.github/workflows/release-blackfort.yml @@ -2,8 +2,8 @@ name: Release for Blackfort on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-celo.yml b/.github/workflows/release-celo.yml index ef7315ab0561..67e534c08677 100644 --- a/.github/workflows/release-celo.yml +++ b/.github/workflows/release-celo.yml @@ -2,8 +2,8 @@ name: Release for Celo on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-eth.yml b/.github/workflows/release-eth.yml index 26b6e17c9902..a510d02bfaa2 100644 --- a/.github/workflows/release-eth.yml +++ b/.github/workflows/release-eth.yml @@ -2,8 +2,8 @@ name: Release for Ethereum on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-filecoin.yml b/.github/workflows/release-filecoin.yml index a92c1dac7216..41e41b4b1287 100644 --- a/.github/workflows/release-filecoin.yml +++ b/.github/workflows/release-filecoin.yml @@ -2,8 +2,8 @@ name: Release for Filecoin on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-fuse.yml b/.github/workflows/release-fuse.yml index e01aff007637..1465cd598551 100644 --- a/.github/workflows/release-fuse.yml +++ b/.github/workflows/release-fuse.yml @@ -2,8 +2,8 @@ name: Release for Fuse on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-gnosis.yml b/.github/workflows/release-gnosis.yml index 652e98dcdbe4..2f69d7bdb2c3 100644 --- a/.github/workflows/release-gnosis.yml +++ b/.github/workflows/release-gnosis.yml @@ -2,8 +2,8 @@ name: Release for Gnosis Chain on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-optimism.yml b/.github/workflows/release-optimism.yml index 2ee5108d00be..469cf2d65850 100644 --- a/.github/workflows/release-optimism.yml +++ b/.github/workflows/release-optimism.yml @@ -2,8 +2,8 @@ name: Release for Optimism on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-polygon-edge.yml b/.github/workflows/release-polygon-edge.yml index 472acc50d914..5e4f49a659b5 100644 --- a/.github/workflows/release-polygon-edge.yml +++ b/.github/workflows/release-polygon-edge.yml @@ -2,8 +2,8 @@ name: Release for Polygon Edge on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-polygon-zkevm.yml b/.github/workflows/release-polygon-zkevm.yml index 35711ba553ba..895afd996c58 100644 --- a/.github/workflows/release-polygon-zkevm.yml +++ b/.github/workflows/release-polygon-zkevm.yml @@ -2,8 +2,8 @@ name: Release for Polygon zkEVM on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-redstone.yml b/.github/workflows/release-redstone.yml index cb979069d02b..1b9b106743ce 100644 --- a/.github/workflows/release-redstone.yml +++ b/.github/workflows/release-redstone.yml @@ -2,8 +2,8 @@ name: Release for Redstone on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-rootstock.yml b/.github/workflows/release-rootstock.yml index 98563c6c8a82..af1c5da74c1a 100644 --- a/.github/workflows/release-rootstock.yml +++ b/.github/workflows/release-rootstock.yml @@ -2,8 +2,8 @@ name: Release for Rootstock on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-scroll.yml b/.github/workflows/release-scroll.yml index ce1083825d38..0168b8c2c497 100644 --- a/.github/workflows/release-scroll.yml +++ b/.github/workflows/release-scroll.yml @@ -2,8 +2,8 @@ name: Release for Scroll on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-shibarium.yml b/.github/workflows/release-shibarium.yml index 61b12acfa68c..f8735b1cc5fc 100644 --- a/.github/workflows/release-shibarium.yml +++ b/.github/workflows/release-shibarium.yml @@ -2,8 +2,8 @@ name: Release for Shibarium on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-stability.yml b/.github/workflows/release-stability.yml index b2230d43a12c..a11a44dd9d1d 100644 --- a/.github/workflows/release-stability.yml +++ b/.github/workflows/release-stability.yml @@ -2,8 +2,8 @@ name: Release for Stability on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-suave.yml b/.github/workflows/release-suave.yml index 64c1fad129fc..12de53d2d67d 100644 --- a/.github/workflows/release-suave.yml +++ b/.github/workflows/release-suave.yml @@ -2,8 +2,8 @@ name: Release for SUAVE on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-zetachain.yml b/.github/workflows/release-zetachain.yml index 807cff7e3226..f1b9d65251d4 100644 --- a/.github/workflows/release-zetachain.yml +++ b/.github/workflows/release-zetachain.yml @@ -2,8 +2,8 @@ name: Release for Zetachain on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-zilliqa.yml b/.github/workflows/release-zilliqa.yml index 1bbd0b2a09ad..d9e8e6174a24 100644 --- a/.github/workflows/release-zilliqa.yml +++ b/.github/workflows/release-zilliqa.yml @@ -2,8 +2,8 @@ name: Release for Zilliqa on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release-zksync.yml b/.github/workflows/release-zksync.yml index 11c6d2791e7c..b6a5e0a42210 100644 --- a/.github/workflows/release-zksync.yml +++ b/.github/workflows/release-zksync.yml @@ -2,8 +2,8 @@ name: Release for ZkSync on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27b0abc5643e..44cdee0afe69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,8 @@ name: Release on: workflow_dispatch: - release: - types: [published] + # release: + # types: [published] env: OTP_VERSION: ${{ vars.OTP_VERSION }}