Manual Deployment #14
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: Checkout dash-network-deploy | |
| uses: actions/checkout@v4 | |
| # Setup SSH keys | |
| - name: Set up SSH Keys | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.EVO_APP_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 | |
| echo "${{ secrets.DEPLOY_SERVER_KEY }}" > ~/.ssh/id_rsa_server | |
| chmod 600 ~/.ssh/id_ed25519 ~/.ssh/id_rsa_server | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| echo "Host *" > ~/.ssh/config | |
| echo " StrictHostKeyChecking no" >> ~/.ssh/config | |
| echo " UserKnownHostsFile=/dev/null" >> ~/.ssh/config | |
| 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' | |
| - run: npm ci | |
| - run: | | |
| rm -rf networks | |
| git clone [email protected]:dashpay/dash-network-configs.git networks | |
| # Create .env files | |
| - name: Create .env files | |
| run: | | |
| cat > .env << EOL | |
| NETWORK=${{ github.event.inputs.network_name }} | |
| COMPOSE_PROJECT_NAME=${{ github.event.inputs.network_name }} | |
| PRESET=${{ github.event.inputs.network_name }} | |
| NODE_ENV=development | |
| NETWORK_PATH=networks/${{ github.event.inputs.network_name }}.yml | |
| PRESETS_PATH=configs/presets | |
| COMPOSE_FILE=docker-compose.yml | |
| DRIVE_BRANCH=master | |
| DAPI_BRANCH=master | |
| DASHMATE_BRANCH=master | |
| EOL | |
| cat > networks/.env << EOL | |
| TERRAFORM_S3_BUCKET="dash-networks-deploy-state" | |
| TERRAFORM_S3_KEY="terraform/state" | |
| TERRAFORM_DYNAMODB_TABLE="dash-networks-deploy-terraform-lock" | |
| AWS_REGION="us-west-2" | |
| EOL | |
| # Install Ansible | |
| - name: Install Ansible | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3-pip python3-netaddr sshpass | |
| python3 -m pip install --user ansible==7.7.0 | |
| ansible-galaxy install -r ansible/requirements.yml --ignore-errors | |
| # Run deploy | |
| - name: Run Deploy Script | |
| env: | |
| ANSIBLE_HOST_KEY_CHECKING: "False" | |
| ANSIBLE_DEPRECATION_WARNINGS: "False" | |
| ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3 | |
| run: | | |
| chmod +x ./bin/deploy | |
| ./bin/deploy -p ${{ github.event.inputs.network_name }} --tags=${{ github.event.inputs.deploy_tag }} |