Skip to content

Commit

Permalink
Add deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
alexb5dh committed Feb 25, 2024
1 parent f8cc46d commit 8798cfc
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/backend-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Backend deploy

on:
push:
branches:
- feature/ci

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}

- name: Copy input secrets to environment variables
uses: oNaiPs/secrets-to-env-action@ec46a22bfc9b37e014b627b3208b07eb8909ea0f
with:
secrets: ${{ toJSON(secrets) }}
include: INPUT_*
convert_prefix: false

- name: Deploy & run docker
run: docker compose up -d
env:
DOCKER_HOST: ${{ format('ssh://{0}@{1}', secrets.SSH_USERNAME, secrets.SSH_HOST) }}
29 changes: 29 additions & 0 deletions app/backend/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
DEPLOYMENT_ENV=dev
API_PORT=8080
LOG_LEVEL=info

DB_URI=${INPUT_DB_URI}
DB_FRESH_START=false
PGSSLMODE=no-verify

PRICING_MODULE_ENABLED=false
PRICING_BASE_URL=https://api.coingecko.com/api/v3
PRICING_API_KEY=${INPUT_COINGECKO_APIKEY}
PRICING_COINCAP_API_KEY=${INPUT_COINCAP_APIKEY}
PRICING_API_KEY_HEADER=x-cg-demo-api-key
PRICING_BACKFILL_PERIOD_DAYS=90
PRICING_MINUTE_RATE_LIMIT=29
PRICING_POLL_INTERVAL_MS=900000

ETHEREUM_RPC_ENDPOINT=${INPUT_ETHEREUM_ENDPOINT}
OPTIMISM_RPC_ENDPOINT=${INPUT_OPTIMISM_ENDPOINT}

ETHEREUM_MONITOR_MODULE_ENABLED=true
ETHEREUM_MONITOR_POLL_INTERVAL_MS=10000
ETHEREUM_MONITOR_START_BLOCK=19296820
ETHEREUM_MONITOR_MAX_LOG_RANGE=5000

OPTIMISM_MODULE_ENABLED=true
OPTIMISM_START_BLOCK=116585680
OPTIMISM_MAX_BLOCK_RANGE=20
OPTIMISM_POLL_INTERVAL_MS=10000

0 comments on commit 8798cfc

Please sign in to comment.