diff --git a/.github/actions/shielder-relayer/deploy/action.yml b/.github/actions/shielder-relayer/deploy/action.yml index 97446d28..5d0385df 100644 --- a/.github/actions/shielder-relayer/deploy/action.yml +++ b/.github/actions/shielder-relayer/deploy/action.yml @@ -27,6 +27,9 @@ inputs: - stage - prod required: true + overwrite-shielder-address: + description: Shielder address to replace the exist one + required: false runs: using: composite @@ -44,6 +47,13 @@ runs: with: kustomize-version: ${{ inputs.kustomize-version }} + - name: Modify shielder address in the config map + if: ${{ inputs.overwrite-shielder-address != '' }} + shell: bash + run: | + yq -i '.data.SHIELDER_CONTRACT_ADDRESS="${{ inputs.overwrite-shielder-address }}"' \ + aleph-apps/shielder-relayer/overlays/${{ inputs.environment }}/eu-central-1/configmap.yaml + - name: KUSTOMIZE | Update docker image tag shell: bash env: diff --git a/.github/workflows/testnet-dev-build-and-deploy-shielder-relayer.yml b/.github/workflows/testnet-dev-build-and-deploy-shielder-relayer.yml new file mode 100644 index 00000000..075ab69c --- /dev/null +++ b/.github/workflows/testnet-dev-build-and-deploy-shielder-relayer.yml @@ -0,0 +1,59 @@ +--- +name: "[DEV] Build and deploy shielder-relayer" + +on: + workflow_dispatch: + inputs: + overwrite-shielder-address: + type: string + required: false + default: '' + description: Overwrite shielder address - if empty it's not changed + +jobs: + build-and-push: + name: Build and push shielder-relayer + runs-on: [self-hosted, Linux, X64, medium] + steps: + - name: GIT | Checkout + uses: actions/checkout@v4 + + - name: Prepare Rust env + uses: ./.github/actions/prepare-rust-env + with: + poseidon-gadget-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + zkos-circuits-private-key: ${{ secrets.ZKOS_CIRCUITS_SSH_PRIVATE_KEY }} + + - name: Build relayer + run: cd crates/shielder-relayer && make build + + - name: DOCKER | Build and push + uses: ./.github/actions/shielder-relayer/build-and-push + id: build_shielder_relayer + with: + aws-mainnet-ecr-access-key-id: ${{ secrets.AWS_MAINNET_ECR_ACCESS_KEY_ID }} + aws-mainnet-ecr-access-key: ${{ secrets.AWS_MAINNET_ECR_ACCESS_KEY }} + ecr-private-host: ${{ secrets.ECR_PRIVATE_HOST }} + outputs: + image_tag: ${{ steps.build_shielder_relayer.outputs.image_tag }} + + deploy: + name: Deploy shielder-relayer + needs: [build-and-push] + runs-on: [self-hosted, Linux, X64, medium] + steps: + - name: GIT | Checkout + uses: actions/checkout@v4 + + - name: KUSTOMIZE | Deploy + uses: ./.github/actions/shielder-relayer/deploy + id: deploy_shielder_relayer + with: + environment: dev + image-tag: ${{ needs.build-and-push.outputs.image_tag }} + autocommit-author: ${{ secrets.AUTOCOMMIT_AUTHOR }} + autocommit-email: ${{ secrets.AUTOCOMMIT_EMAIL }} + github-token: ${{ secrets.CI_GH_TOKEN }} + kustomize-version: ${{ vars.KUSTOMIZE_VERSION }} + ecr-private-host: ${{ secrets.ECR_PRIVATE_HOST }} + overwrite-shielder-address: ${{ inputs.overwrite-shielder-address }} diff --git a/.github/workflows/testnet-build-and-deploy-shielder-relayer.yml b/.github/workflows/testnet-stage-build-and-deploy-shielder-relayer.yml similarity index 86% rename from .github/workflows/testnet-build-and-deploy-shielder-relayer.yml rename to .github/workflows/testnet-stage-build-and-deploy-shielder-relayer.yml index 07806b6e..06ede586 100644 --- a/.github/workflows/testnet-build-and-deploy-shielder-relayer.yml +++ b/.github/workflows/testnet-stage-build-and-deploy-shielder-relayer.yml @@ -1,8 +1,14 @@ --- -name: "[TESTNET] Build and deploy shielder-relayer" +name: "[STAGE] Build and deploy shielder-relayer" on: workflow_dispatch: + inputs: + overwrite-shielder-address: + type: string + required: false + default: '' + description: Overwrite shielder address - if empty it's not changed jobs: build-and-push: @@ -43,7 +49,7 @@ jobs: uses: ./.github/actions/shielder-relayer/deploy id: deploy_shielder_relayer with: - environment: dev + environment: stage image-tag: ${{ needs.build-and-push.outputs.image_tag }} autocommit-author: ${{ secrets.AUTOCOMMIT_AUTHOR }} autocommit-email: ${{ secrets.AUTOCOMMIT_EMAIL }}