Skip to content

Deploy MAINNET Seed #190

Deploy MAINNET Seed

Deploy MAINNET Seed #190

name: Deploy MAINNET Seed
on:
workflow_dispatch:
inputs:
tagName:
description: 'Tag or branch to deploy'
default: 'main'
required: true
# 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
BRANCH=$(basename ${{ github.ref }})
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST \
"cd /root/rooch && git fetch origin && git checkout -B $BRANCH origin/$BRANCH || git checkout $BRANCH && bash scripts/deploy_rooch_mainnet.sh \
'${{ env.REF }}' \
'${{ secrets.BTC_MAIN_RPC_URL }}' \
'${{ secrets.BTC_MAIN_RPC_PWD }}' \
'${{ secrets.OPENDA_GCP_MAINNET_BUCKET }}' \
'${{ secrets.OPENDA_GCP_MAINNET_CREDENTIAL }}'"