Skip to content

Deploy MAINNET Seed #150

Deploy MAINNET Seed

Deploy MAINNET Seed #150

name: Deploy MAINNET Seed
on:
workflow_dispatch:
inputs:
tagName:
description: 'Tag Name to Checkout'
required: true
default: 'latest'
workflow_run:
workflows: ["Build Docker And Deploy Seed"]
types:
- completed
jobs:
deploy-rooch-mainnet:
name: deploy rooch mainnet
runs-on: self-hosted
steps:
- name: Deploy to GCP MAINNET VM
env:
PRIVATE_KEY: ${{ secrets.GCP_MAINNET_SSH_PRIVATE_KEY }}
HOST: ${{ secrets.GCP_MAINNET_VM_HOST }}
USER: ${{ secrets.GCP_MAINNET_VM_USER }}
run: |
echo "$PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem
sudo apt update
sudo apt install -y --no-install-recommends openssh-server
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && && docker image prune -a -f && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ github.event.inputs.tagName }}' && docker run -d -v /data:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ github.event.inputs.tagName }}' server start -n main --btc-rpc-url '${{secrets.BTC_MAIN_RPC_URL}}' --btc-rpc-username rooch-main --btc-rpc-password '${{secrets.BTC_MAIN_RPC_PWD}}' --btc-start-block-height 0 --btc-end-block-height 767420 --data-import-mode 1"