Skip to content

Commit

Permalink
ZK-612: Add workflow for deploying to stage (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajgs authored Dec 12, 2024
1 parent 60321d0 commit 759a84d
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
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

0 comments on commit 759a84d

Please sign in to comment.