Manual Deployment #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Manual Deployment | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| 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: Fail if unauthorized user | |
| if: ${{ github.actor != 'vivekgsharma' && github.actor != 'ktechmidas' }} | |
| run: | | |
| echo "Unauthorized user: ${{ github.actor }}" | |
| exit 1 | |
| - name: Checkout dash-network-deploy | |
| uses: actions/checkout@v4 | |
| # Setup SSH key to pull private dash-network-configs repo | |
| - name: Set up GitHub SSH Key | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.EVO_APP_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| # Setup SSH key to connect to deployment servers | |
| - name: Set up Server SSH Key | |
| run: | | |
| echo "${{ secrets.DEPLOY_SERVER_KEY }}" > ~/.ssh/id_rsa_server | |
| chmod 600 ~/.ssh/id_rsa_server | |
| # Clone latest configs into networks/ folder | |
| - name: Clone dash-network-configs | |
| run: | | |
| rm -rf networks | |
| git clone git@github.com:dashpay/dash-network-configs.git networks | |
| # Generate basic .env file with selected network name | |
| - name: Generate .env file | |
| run: | | |
| echo "NETWORK=${{ github.event.inputs.network_name }}" > .env | |
| # Install Ansible and Python dependencies | |
| - name: Install Ansible and Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3-pip | |
| pip3 install ansible | |
| # Install required Ansible roles from Galaxy | |
| - name: Install Ansible Galaxy Roles | |
| run: | | |
| ansible-galaxy install -r ansible/requirements.yml | |
| # Install Node.js dependencies (required for firstRun.js) | |
| - name: Install Node.js dependencies | |
| run: | | |
| npm ci || npm install | |
| # Optional: Check if inventory file exists | |
| - name: Check inventory file exists | |
| run: | | |
| if [ ! -f "networks/${{ github.event.inputs.network_name }}.inventory" ]; then | |
| echo "Inventory file not found: networks/${{ github.event.inputs.network_name }}.inventory" | |
| exit 1 | |
| fi | |
| # Run the deploy wrapper script with the selected tag and network | |
| - name: Run Deploy Script | |
| run: | | |
| chmod +x ./bin/deploy | |
| NETWORK=${{ github.event.inputs.network_name }} ./bin/deploy -p ${{ github.event.inputs.network_name }} --tags=${{ github.event.inputs.deploy_tag }} |