Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZK-612: Add workflow for deploying to stage #51

Merged
merged 6 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/actions/shielder-relayer/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down