This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
Test new bare metal prod server #1
This file contains 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: Deploy new production new | |
concurrency: | |
group: ${{ github.workflow }} | |
on: | |
push: | |
branches: | |
- test-new-prod-server | |
jobs: | |
build-deploy: | |
name: Build and deploy to production | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Create ssh private key file from env var | |
env: | |
SSH_KEY: ${{ secrets.SSH_KEY }} | |
run: | | |
set -ex | |
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > id_ed25519_production | |
chmod 400 id_ed25519_production | |
- name: Install ansible | |
run: | | |
pip install ansible | |
- name: "Deploy with ansible" | |
env: | |
MIX_ENV: ${{ vars.MIX_ENV }} | |
DB_TYPE: ${{ vars.DB_TYPE }} | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }} | |
PHX_HOST: ${{ vars.PHX_HOST }} | |
PHX_SERVER: ${{ vars.PHX_SERVER }} | |
RPC_API_HOST: ${{ secrets.RPC_API_HOST }} | |
TESTNET_RPC_API_HOST: ${{ secrets.TESTNET_RPC_API_HOST }} | |
TESTNET_2_RPC_API_HOST: ${{ secrets.TESTNET_2_RPC_API_HOST }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ vars.AWS_REGION }} | |
PROVER_STORAGE: ${{ vars.PROVER_STORAGE }} | |
ANSIBLE_SSH_PKEY_DIR: "./id_ed25519_production" | |
SSH_HOST: ${{ vars.NEW_SSH_HOST }} | |
GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
ANSIBLE_STDOUT_CALLBACK: "yaml" | |
NEWRELIC_KEY: "321" | |
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }} | |
SENTRY_ENV: "production" | |
SENTRY_DSN: "123" | |
ENABLE_MAINNET_SYNC: "true" | |
ENABLE_TESTNET_SYNC: "true" | |
ENABLE_TESTNET2_SYNC: "true" | |
ENABLE_GATEWAY_DATA: "true" | |
run: | | |
ansible-playbook -i ansible/inventory.yaml ansible/playbooks/deployment.yaml |