Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: uncomment deploy_v2 #143

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions .github/workflows/deploy_mainnet.yml
MakMuftic marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
required: false
default: 'stable'
type: string
# deploy_v2:
# description: deploy v2
# type: string
deploy_v2:
description: deploy v2
type: string

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
Expand Down Expand Up @@ -68,52 +68,52 @@ jobs:
cluster: sygma-explorer-${{ env.ENVIRONMENT }}
wait-for-service-stability: true

# deploy_v2:
# name: deploy v2
#
# runs-on: ubuntu-latest

# permissions:
# contents: read
# id-token: write
# actions: write

# steps:
# - name: checkout the source code
# uses: actions/checkout@v3

# - name: checkout ecs repo
# uses: actions/checkout@v3
# with:
# repository: sygmaprotocol/devops
# token: ${{ secrets.GHCR_TOKEN }}
# ref: main

# - name: render jinja2 templates to task definition json files
# uses: cuchi/[email protected]
# with:
# template: 'sygma-explorer/ecs/task_definition-explorer-indexer-${{ env.ENVIRONMENT }}-v2.j2'
# output_file: 'sygma-explorer/ecs/task_definition-explorer-indexer-${{ env.ENVIRONMENT }}.json'
# data_format: json
# variables: |
# awsAccountId=${{ env.AWS_MAINNET }}
# awsRegion=${{ env.AWS_REGION }}
# awsEnv=${{ env.ENVIRONMENT }}
# DB_USERNAME=${{ secrets.MAIN_USERNAME_v2 }}
# DB_PASSWORD=${{ secrets.MAIN_PASSWORD_v2 }}
# imageTag=${{ inputs.deploy_v2 }}

# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# role-to-assume: arn:aws:iam::${{ env.AWS_MAINNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
# aws-region: ${{ env.AWS_REGION }}
# role-session-name: GithubActions

# - name: Deploy to Amazon ECS
# uses: aws-actions/amazon-ecs-deploy-task-definition@v1
# with:
# task-definition: sygma-explorer/ecs/task_definition-explorer-indexer-${{ env.ENVIRONMENT }}.json
# service: explorer-indexer-service-v2-${{ env.ENVIRONMENT }}
# cluster: sygma-explorer-${{ env.ENVIRONMENT }}
# wait-for-service-stability: true
deploy_v2:
name: deploy v2

runs-on: ubuntu-latest

permissions:
contents: read
id-token: write
actions: write

steps:
- name: checkout the source code
uses: actions/checkout@v3

- name: checkout ecs repo
uses: actions/checkout@v3
with:
repository: sygmaprotocol/devops
token: ${{ secrets.GHCR_TOKEN }}
ref: main

- name: render jinja2 templates to task definition json files
uses: cuchi/[email protected]
with:
template: 'sygma-explorer/ecs/task_definition-explorer-indexer-${{ env.ENVIRONMENT }}-v2.j2'
output_file: 'sygma-explorer/ecs/task_definition-explorer-indexer-${{ env.ENVIRONMENT }}.json'
data_format: json
variables: |
awsAccountId=${{ env.AWS_MAINNET }}
awsRegion=${{ env.AWS_REGION }}
awsEnv=${{ env.ENVIRONMENT }}
DB_USERNAME=${{ secrets.MAIN_USERNAME_v2 }}
DB_PASSWORD=${{ secrets.MAIN_PASSWORD_v2 }}
imageTag=${{ inputs.deploy_v2 }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_MAINNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ env.AWS_REGION }}
role-session-name: GithubActions

- name: Deploy to Amazon ECS
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: sygma-explorer/ecs/task_definition-explorer-indexer-${{ env.ENVIRONMENT }}.json
service: explorer-indexer-service-v2-${{ env.ENVIRONMENT }}
cluster: sygma-explorer-${{ env.ENVIRONMENT }}
wait-for-service-stability: true
Loading