chore: Migration from Datadog to Grafana (#42) #9
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 TESTNET | |
on: | |
push: | |
paths: | |
- 'ecs/**' | |
- '.github/workflows/deploy_ecs_STAGE_EXT.yml' | |
branches: | |
- main | |
env: | |
AWS_REGION: '${{ secrets.AWS_REGION }}' | |
ENVIRONMENT: 'STAGE_EXT' | |
PROJECT_NAME: "relayers" | |
TAG: "Demo" | |
AWS_TESTNET: '${{ secrets.AWS_ARN }}' | |
AWS_ROLE: '${{ secrets.AWS_ROLE_NAME }}' | |
IMAGE_VERSION: '' | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
relayer_id: [5] | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: checkout the source code | |
uses: actions/checkout@v3 | |
- name: render jinja2 templates to task definition json files | |
uses: cuchi/[email protected] | |
with: | |
template: 'ecs/task_definition_${{ env.ENVIRONMENT }}.j2' | |
output_file: 'ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json' | |
data_format: json | |
variables: | | |
relayerId=${{ matrix.relayer_id }} | |
awsAccountId=${{ env.AWS_TESTNET }} | |
awsRegion=${{ env.AWS_REGION }} | |
relayerName=${{ env.PROJECT_NAME }} | |
appTag=${{ env.TAG }} | |
imageTag=${{ env.IMAGE_VERSION }} | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: arn:aws:iam::${{ env.AWS_TESTNET }}:role/${{env.AWS_ROLE}} | |
aws-region: ${{ env.AWS_REGION }} | |
role-session-name: GithubActions | |
- name: deploy task definition | |
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | |
with: | |
task-definition: 'ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json' | |
service: '${{ env.PROJECT_NAME }}-${{ matrix.relayer_id }}-service-${{ env.TAG }}' | |
cluster: 'relayer-${{ env.TAG }}' | |
wait-for-service-stability: true |