test: trigger deploy #229
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 | |
on: | |
push: | |
branches: [main, dev, ci/iam-roles-and-aws-secrets-sub-accounts] | |
tags: ['v*.*.*'] | |
jobs: | |
init: | |
runs-on: ubuntu-latest | |
outputs: | |
environment: ${{ steps.setenv.outputs.environment}} | |
steps: | |
- name: Set environment | |
id: setenv | |
run: | | |
if [[ "${{github.ref}}" == refs/tags/v* ]]; then | |
echo "Setting mainnet environment" | |
echo "environment=mainnet" >> $GITHUB_OUTPUT | |
elif [[ "${{github.base_ref}}" == "main" || "${{github.ref}}" == "refs/heads/main" ]]; then | |
echo "Setting testnet environment" | |
echo "environment=testnet" >> $GITHUB_OUTPUT | |
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then | |
echo "Setting dev environment" | |
echo "environment=dev" >> $GITHUB_OUTPUT | |
elif [[ "${{github.base_ref}}" == "ci/iam-roles-and-aws-secrets-sub-accounts" || "${{github.ref}}" == "refs/heads/ci/iam-roles-and-aws-secrets-sub-accounts" ]]; then | |
echo "Setting dev environment" | |
echo "environment=dev" >> $GITHUB_OUTPUT | |
fi | |
echo "timestamp=`date +%s`" >> $GITHUB_OUTPUT | |
dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout/releases/tag/v3.5.3 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Set up Node.js 18.x | |
# https://github.com/actions/setup-node/releases/tag/v3.7.0 | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 | |
with: | |
node-version: 18.x | |
- name: Cache node modules | |
# https://github.com/actions/cache/releases/tag/v3.3.1 | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: /home/runner/work/hathor-explorer/hathor-explorer/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Npm Dependencies | |
run: | | |
npm ci | |
- name: Pack node modules | |
run: | | |
tar -cvf node_modules.tar ./node_modules | |
- name: Upload node modules | |
uses: actions/upload-artifact@v2 | |
with: | |
name: node_modules | |
path: node_modules.tar | |
if-no-files-found: error | |
retention-days: 1 | |
deploy-dev: | |
runs-on: ubuntu-latest | |
needs: [init, dependencies] | |
if: ${{ needs.init.outputs.environment == 'dev' }} | |
steps: | |
- name: Call reusable deploy workflow | |
uses: ./.github/reusable-workflows/deploy.yml | |
with: | |
aws_region: eu-central-1 | |
aws_iam_role: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole | |
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/dev-0ikehC | |
serverless_stage: dev | |
docker_image_tag: dev-${{ github.sha }}-${{ needs.init.outputs.timestamp }} | |
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Fdev®ion=eu-central-1 | |
api_port: 3001 | |
hathor_core_url: https://node.explorer.testnet.hathor.network | |
hathor_nodes: https://node1.testnet.hathor.network,https://node.explorer.testnet.hathor.network | |
redis_key_prefix: hathor-explorer-service-dev | |
redis_port: 6379 | |
redis_db: 0 | |
metadata_bucket: hathor-explorer-metadata-dev | |
cors_allowed_regex: .* | |
elastic_index: dev-token | |
elastic_tx_index: dev-tx | |
elastic_token_balances_index: dev-token-balance | |
healthcheck_hathor_core_enabled: true | |
healthcheck_wallet_service_db_enabled: true | |
healthcheck_elasticsearch_enabled: true | |
healthcheck_redis_enabled: true | |
deploy-testnet: | |
runs-on: ubuntu-latest | |
needs: [init, dependencies] | |
if: ${{ needs.init.outputs.environment == 'testnet' }} | |
steps: | |
- name: Call reusable deploy workflow | |
uses: ./.github/reusable-workflows/deploy.yml | |
with: | |
aws_region: eu-central-1 | |
aws_iam_role: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole | |
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/testnet-lcBuyc | |
serverless_stage: testnet | |
docker_image_tag: testnet-${{ github.sha }}-${{ needs.init.outputs.timestamp }} | |
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Ftestnet®ion=eu-central-1 | |
api_port: 3001 | |
hathor_core_url: https://node.explorer.testnet.hathor.network | |
hathor_nodes: https://node1.testnet.hathor.network,https://node.explorer.testnet.hathor.network | |
redis_key_prefix: hathor-explorer-service-testnet | |
redis_port: 6379 | |
redis_db: 0 | |
metadata_bucket: hathor-explorer-metadata-testnet | |
cors_allowed_regex: https?:\/\/([a-z0-9]*\.){0,5}hathor\.network | |
elastic_index: testnet-token | |
elastic_tx_index: testnet-tx | |
elastic_token_balances_index: testnet-token-balance | |
healthcheck_hathor_core_enabled: true | |
healthcheck_wallet_service_db_enabled: true | |
healthcheck_elasticsearch_enabled: true | |
healthcheck_redis_enabled: true | |
deploy-nano-testnet: | |
runs-on: ubuntu-latest | |
needs: [init, dependencies] | |
if: ${{ needs.init.outputs.environment == 'testnet' }} | |
steps: | |
- name: Call reusable deploy workflow | |
uses: ./.github/reusable-workflows/deploy.yml | |
with: | |
aws_region: eu-central-1 | |
aws_iam_role: arn:aws:iam::471112952246:role/ExplorerServiceGitHubActionsRole | |
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:471112952246:secret:ExplorerService/nano-testnet-MWxHpF | |
serverless_stage: nano | |
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Fnano-testnet®ion=eu-central-1 | |
api_port: 3001 | |
hathor_core_url: https://node1.nano-testnet.hathor.network | |
hathor_nodes: https://node1.nano-testnet.hathor.network | |
redis_key_prefix: hathor-explorer-service-nano-testnet | |
redis_port: 6379 | |
redis_db: 1 | |
metadata_bucket: hathor-explorer-metadata-nano-testnet | |
cors_allowed_regex: https?:\/\/([a-z0-9]*\.){0,5}hathor\.network | |
elastic_index: nano-testnet-token | |
elastic_tx_index: nano-testnet-tx | |
elastic_token_balances_index: nano-testnet-token-balance | |
healthcheck_hathor_core_enabled: true | |
healthcheck_wallet_service_db_enabled: true | |
healthcheck_elasticsearch_enabled: true | |
healthcheck_redis_enabled: true | |
deploy-ekvilibro-testnet: | |
runs-on: ubuntu-latest | |
needs: [init, dependencies] | |
if: ${{ needs.init.outputs.environment == 'testnet' }} | |
steps: | |
- name: Call reusable deploy workflow | |
uses: ./.github/reusable-workflows/deploy.yml | |
with: | |
aws_region: eu-central-1 | |
aws_iam_role: arn:aws:iam::730335348496:role/ExplorerServiceGitHubActionsRole | |
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:730335348496:secret:ExplorerService/ekvilibro-testnet-DaDPgT | |
serverless_stage: ekvilibro | |
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Fekvilibro-testnet®ion=eu-central-1 | |
api_port: 3001 | |
hathor_core_url: https://node-side-dag.ekvilibro-testnet.hathor.network | |
hathor_nodes: https://node-side-dag.ekvilibro-testnet.hathor.network | |
redis_key_prefix: hathor-explorer-service-ekvilibro-testnet | |
redis_port: 6379 | |
redis_db: 0 | |
metadata_bucket: hathor-explorer-metadata-ekvilibro-testnet | |
cors_allowed_regex: https?:\/\/([a-z0-9]*\.){0,5}hathor\.network | |
elastic_index: ekvilibro-testnet-token | |
elastic_tx_index: ekvilibro-testnet-tx | |
elastic_token_balances_index: ekvilibro-testnet-token-balance | |
healthcheck_hathor_core_enabled: true | |
healthcheck_wallet_service_db_enabled: true | |
healthcheck_elasticsearch_enabled: true | |
healthcheck_redis_enabled: true | |
deploy-ekvilibro-mainnet: | |
runs-on: ubuntu-latest | |
needs: [init, dependencies] | |
if: ${{ needs.init.outputs.environment == 'mainnet' }} | |
steps: | |
- name: Call reusable deploy workflow | |
uses: ./.github/reusable-workflows/deploy.yml | |
with: | |
aws_region: eu-central-1 | |
aws_iam_role: arn:aws:iam::730335348496:role/ExplorerServiceGitHubActionsRole | |
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:730335348496:secret:ExplorerService/ekvilibro-mainnet-yvc3s2 | |
serverless_stage: ekvi-main | |
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Fekvilibro-mainnet®ion=eu-central-1 | |
api_port: 3001 | |
hathor_core_url: https://node-side-dag.ekvilibro-mainnet.hathor.network | |
hathor_nodes: https://node-side-dag.ekvilibro-mainnet.hathor.network | |
redis_key_prefix: hathor-explorer-service-ekvilibro-mainnet | |
redis_port: 6379 | |
redis_db: 0 | |
metadata_bucket: hathor-explorer-metadata-ekvilibro-mainnet | |
cors_allowed_regex: https?:\/\/([a-z0-9]*\.){0,5}hathor\.network | |
elastic_index: ekvilibro-mainnet-token | |
elastic_tx_index: ekvilibro-mainnet-tx | |
elastic_token_balances_index: ekvilibro-mainnet-token-balance | |
healthcheck_hathor_core_enabled: true | |
healthcheck_wallet_service_db_enabled: true | |
healthcheck_elasticsearch_enabled: true | |
healthcheck_redis_enabled: true | |
deploy-mainnet: | |
runs-on: ubuntu-latest | |
needs: [init, dependencies] | |
if: ${{ needs.init.outputs.environment == 'mainnet' }} | |
steps: | |
- name: Call reusable deploy workflow | |
uses: ./.github/reusable-workflows/deploy.yml | |
with: | |
aws_region: eu-central-1 | |
aws_iam_role: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole | |
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/mainnet-DYYHfn | |
serverless_stage: mainnet | |
docker_image_tag: ${GITHUB_REF#refs/*/} | |
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Fmainnet®ion=eu-central-1 | |
api_port: 3001 | |
hathor_core_url: https://node.explorer.hathor.network | |
hathor_nodes: https://node.explorer.hathor.network,https://node1.mainnet.hathor.network,https://node2.mainnet.hathor.network | |
redis_key_prefix: hathor-explorer-service-mainnet | |
redis_port: 6379 | |
redis_db: 0 | |
metadata_bucket: hathor-explorer-metadata-mainnet | |
cors_allowed_regex: https?:\/\/([a-z0-9]*\.){0,5}hathor\.network | |
elastic_index: mainnet-token | |
elastic_tx_index: mainnet-tx | |
elastic_token_balances_index: mainnet-token-balance | |
healthcheck_hathor_core_enabled: true | |
healthcheck_wallet_service_db_enabled: true | |
healthcheck_elasticsearch_enabled: true | |
healthcheck_redis_enabled: true |