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

feat: Added deploy script for checking deployments #738

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Added CI for deploy-checker on deploy
Phuong Nguyen committed Jul 29, 2024
commit 6300609dfe51fdd0ae94522812ff823acbada89d
2 changes: 1 addition & 1 deletion .github/workflows/multichain-contract.yml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ jobs:
- uses: Swatinem/rust-cache@v1

- name: Compile Contract
run: cd ./chain-signatures && cargo build -p mpc-contract --target wasm32-unknown-unknown --release
run: cd ./chain-signatures && cargo build -p mpc-contract --target wasm32-unknown-unknown --release --features dev

- name: Test Contract
run: cd ./chain-signatures && cargo test -p mpc-contract --target x86_64-unknown-linux-gnu --release
45 changes: 34 additions & 11 deletions .github/workflows/multichain-dev.yml
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@ env:
TAG: ${{ github.sha }}

jobs:
build-mpc-recovery:
build-chain-signatures:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: "Checkout mpc-recovery"
name: "Checkout chain-signatures"

- name: Login to GCP Artifact Registry
run: echo "$GOOGLE_CREDENTIALS" | docker login -u _json_key --password-stdin https://us-east1-docker.pkg.dev
@@ -32,23 +32,46 @@ jobs:
file: ./Dockerfile.multichain
tags: "${{ env.IMAGE }}:${{ env.TAG }}"

check-deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: build-chain-signatures
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- uses: Swatinem/rust-cache@v1
- name: Compile Contract
working-directory: chain-signatures
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release --features dev

- name: Build Deploy Script
working-directory: infra/scripts/deploy
run: cargo build --release
- name: Run Deploy Check
working-directory: infra/scripts/deploy
run: cargo run --release -- check --network testnet --mpc-contract-id "v5.multichain-mpc-dev.testnet"

deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: build-mpc-recovery
needs: check-deploy
steps:
- id: 'auth'
uses: 'google-github-actions/auth@v2'
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS_DEV }}'
credentials_json: "${{ secrets.GCP_CREDENTIALS_DEV }}"

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"

- name: 'Set project'
run: 'gcloud config set project pagoda-discovery-platform-dev'
- name: "Set project"
run: "gcloud config set project pagoda-discovery-platform-dev"

- name: 'Update Nodes'
- name: "Update Nodes"
run: |
gcloud compute instances update-container multichain-dev-0 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \
gcloud compute instances update-container multichain-dev-1 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \