Skip to content

Manual Deployment

Manual Deployment #30

Workflow file for this run

name: Manual Deployment
on:
workflow_dispatch:
inputs:
network_type:
description: "Network type (e.g., devnet, testnet, regtest)"
required: true
type: string
network_name:
description: "Network to deploy (e.g., devnet-cobblet, testnet)"
required: true
type: string
deploy_tag:
description: "Ansible tag to run (e.g., full_deploy, platform_update)"
required: true
type: string
jobs:
deploy:
name: Deploy Dash Network
runs-on: ubuntu-latest
steps:
- name: Checkout dash-network-deploy
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Ansible
run: |
python -m pip install --upgrade pip
pip install ansible
# Setup SSH keys
- name: Install Ansible roles
run: |
ansible-galaxy install -r ansible/requirements.yml
- name: Set up SSH Keys
run: |
mkdir -p ~/.ssh
# GitHub deploy key for cloning configs
echo "${{ secrets.EVO_APP_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# Server SSH key for connecting to nodes
echo "${{ secrets.DEPLOY_SERVER_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# SSH config
cat > ~/.ssh/config << 'EOL'
Host github.com
IdentityFile ~/.ssh/id_ed25519
StrictHostKeyChecking no
Host *
IdentityFile ~/.ssh/id_rsa
User ubuntu
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
EOL
chmod 600 ~/.ssh/config
# Set up Node.js and clone configs
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm ci
# Clone network configs
- name: Clone network configs
run: |
rm -rf networks
git clone [email protected]:dashpay/dash-network-configs.git networks
# Verify network config exists
- name: Check network config
run: |
if [ ! -f "networks/${{ github.event.inputs.network_name }}.yml" ]; then
echo "Error: Network config networks/${{ github.event.inputs.network_name }}.yml not found"
exit 1
fi
# Install Ansible and Python dependencies
- name: Install Ansible and Dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip python3-netaddr sshpass
pip3 install ansible
# Install required Ansible roles from Galaxy and local roles
- name: Install Ansible Roles
run: |
mkdir -p ~/.ansible/roles
cp -r ansible/roles/* ~/.ansible/roles/
# Run deploy
- name: Run Deploy Script
env:
ANSIBLE_CONFIG: ansible.cfg
NETWORK: ${{ github.event.inputs.network_name }}
NETWORK_PATH: networks/${{ github.event.inputs.network_name }}.yml
ANSIBLE_HOST_KEY_CHECKING: "false"
run: |
pwd
ls -la
ls -la networks/
chmod +x ./bin/github-deploy
./bin/github-deploy -p ${{ github.event.inputs.network_name }} --tags ${{ github.event.inputs.deploy_tag }}