-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
253 additions
and
166 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
# .github/workflows/deploy.yml | ||
name: Deploy | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
ELASTIC_SEARCH_TIMEOUT: 25 | ||
ELASTIC_RESULTS_PER_PAGE: 10 | ||
NODE_CACHE_TTL: 30 | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
aws_region: | ||
description: 'AWS Region' | ||
required: true | ||
type: string | ||
aws_iam_role: | ||
description: 'AWS IAM Role' | ||
required: true | ||
type: string | ||
aws_secret_arn: | ||
description: 'AWS Secret ARN' | ||
required: true | ||
type: string | ||
serverless_stage: | ||
description: 'Serverless Stage' | ||
required: true | ||
type: string | ||
docker_image_tag: | ||
description: 'Docker Image Tag' | ||
required: false | ||
default: '' | ||
type: string | ||
api_port: | ||
description: 'API Port' | ||
required: true | ||
type: string | ||
hathor_core_url: | ||
description: 'Hathor Core URL' | ||
required: true | ||
type: string | ||
hathor_nodes: | ||
description: 'Hathor Nodes' | ||
required: true | ||
type: string | ||
redis_key_prefix: | ||
description: 'Redis Key Prefix' | ||
required: true | ||
type: string | ||
redis_port: | ||
description: 'Redis Port' | ||
required: true | ||
type: string | ||
redis_db: | ||
description: 'Redis DB' | ||
required: true | ||
type: string | ||
metadata_bucket: | ||
description: 'Metadata Bucket' | ||
required: true | ||
type: string | ||
cors_allowed_regex: | ||
description: 'CORS Allowed Regex' | ||
required: true | ||
type: string | ||
elastic_index: | ||
description: 'Elastic Index' | ||
required: true | ||
type: string | ||
elastic_tx_index: | ||
description: 'Elastic TX Index' | ||
required: true | ||
type: string | ||
elastic_token_balances_index: | ||
description: 'Elastic Token Balances Index' | ||
required: true | ||
type: string | ||
healthcheck_hathor_core_enabled: | ||
description: 'Healthcheck Hathor Core Enabled' | ||
required: true | ||
type: boolean | ||
healthcheck_wallet_service_db_enabled: | ||
description: 'Healthcheck Wallet Service DB Enabled' | ||
required: true | ||
type: boolean | ||
healthcheck_elasticsearch_enabled: | ||
description: 'Healthcheck Elasticsearch Enabled' | ||
required: true | ||
type: boolean | ||
healthcheck_redis_enabled: | ||
description: 'Healthcheck Redis Enabled' | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare deploy | ||
uses: ./.github/actions/prepare-deploy | ||
with: | ||
aws_region: ${{ inputs.aws_region }} | ||
aws_iam_role: ${{ inputs.aws_iam_role }} | ||
aws_secret_arn: ${{ inputs.aws_secret_arn }} | ||
|
||
- name: Deploy Lambdas | ||
run: | | ||
make deploy-lambdas-ci stage=${{ inputs.serverless_stage }} | ||
env: | ||
AWS_DEFAULT_REGION: ${{ inputs.aws_region }} | ||
API_PORT: ${{ inputs.api_port }} | ||
HATHOR_CORE_URL: ${{ inputs.hathor_core_url }} | ||
HATHOR_NODES: ${{ inputs.hathor_nodes }} | ||
REDIS_KEY_PREFIX: ${{ inputs.redis_key_prefix }} | ||
REDIS_PORT: ${{ inputs.redis_port }} | ||
REDIS_DB: ${{ inputs.redis_db }} | ||
METADATA_BUCKET: ${{ inputs.metadata_bucket }} | ||
CORS_ALLOWED_REGEX: ${{ inputs.cors_allowed_regex }} | ||
ELASTIC_INDEX: ${{ inputs.elastic_index }} | ||
ELASTIC_TX_INDEX: ${{ inputs.elastic_tx_index }} | ||
ELASTIC_TOKEN_BALANCES_INDEX: ${{ inputs.elastic_token_balances_index }} | ||
HEALTHCHECK_HATHOR_CORE_ENABLED: ${{ inputs.healthcheck_hathor_core_enabled }} | ||
HEALTHCHECK_WALLET_SERVICE_DB_ENABLED: ${{ inputs.healthcheck_wallet_service_db_enabled }} | ||
HEALTHCHECK_ELASTICSEARCH_ENABLED: ${{ inputs.healthcheck_elasticsearch_enabled }} | ||
HEALTHCHECK_REDIS_ENABLED: ${{ inputs.healthcheck_redis_enabled }} | ||
|
||
- name: Deploy Daemons | ||
# Deploy only if the inputs.docker_image_tag is not empty | ||
if: ${{ inputs.docker_image_tag != '' }} | ||
run: | | ||
export DOCKER_IMAGE_TAG=${{ inputs.docker_image_tag }} | ||
make deploy-daemons | ||
rm /home/runner/.docker/config.json |
Oops, something went wrong.