Skip to content

Commit

Permalink
enabled region_1 pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
eedygreen committed Oct 10, 2023
1 parent ae91338 commit 47f0697
Showing 1 changed file with 61 additions and 61 deletions.
122 changes: 61 additions & 61 deletions .github/workflows/deploy_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,67 +24,67 @@ env:

jobs:
######################## region 1 ########################
# deploy_region_1:
# name: deploy
# runs-on: ubuntu-latest
# strategy:
# matrix:
# relayer_id: [0, 1]

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

# steps:
# - name: Authentication
# id: auth
# run: |
# if [ "${{ secrets.AUTH_TOKEN }}" != "${{ github.event.inputs.TOKEN }}" ]; then
# echo "Authentcation failed. Exiting..."
# exit 1
# fi
# - name: Continue
# if: steps.auth.outcome == 'success'
# run: |
# echo 'Authentication Succeeded!!!'

# - 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 }}

# - name: render jinja2 templates to task definition json files
# uses: cuchi/jinja2-action@v1.2.0
# with:
# template: 'relayers/ecs/task_definition-${{ env.ENVIRONMENT }}.j2'
# output_file: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
# data_format: json
# variables: |
# relayerId=${{ matrix.relayer_id }}
# awsAccountId=${{ env.AWS_MAINNET }}
# awsRegion=${{ secrets.AWS_REGION }}
# imageTag=${{ inputs.release_tag }}
# awsEnv=${{ env.ENVIRONMENT }}
# awsEfs=${{ secrets.MAINNET_EFS_1 }}

# - 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: ${{ secrets.AWS_REGION }}
# role-session-name: GithubActions

# - name: deploy task definition
# uses: aws-actions/amazon-ecs-deploy-task-definition@v1
# with:
# task-definition: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
# service: 'relayer-${{ matrix.relayer_id }}-service-${{ env.ENVIRONMENT }}'
# cluster: 'relayer-${{ env.ENVIRONMENT }}'
# wait-for-service-stability: true
deploy_region_1:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
relayer_id: [0, 1]

permissions:
contents: read
id-token: write

steps:
- name: Authentication
id: auth
run: |
if [ "${{ secrets.AUTH_TOKEN }}" != "${{ github.event.inputs.TOKEN }}" ]; then
echo "Authentcation failed. Exiting..."
exit 1
fi
- name: Continue
if: steps.auth.outcome == 'success'
run: |
echo 'Authentication Succeeded!!!'
- 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 }}

- name: render jinja2 templates to task definition json files
uses: cuchi/jinja2-action@v1.2.0
with:
template: 'relayers/ecs/task_definition-${{ env.ENVIRONMENT }}.j2'
output_file: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
data_format: json
variables: |
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_MAINNET }}
awsRegion=${{ secrets.AWS_REGION }}
imageTag=${{ inputs.release_tag }}
awsEnv=${{ env.ENVIRONMENT }}
awsEfs=${{ secrets.MAINNET_EFS_1 }}
- 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: ${{ secrets.AWS_REGION }}
role-session-name: GithubActions

- name: deploy task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
service: 'relayer-${{ matrix.relayer_id }}-service-${{ env.ENVIRONMENT }}'
cluster: 'relayer-${{ env.ENVIRONMENT }}'
wait-for-service-stability: true

######################## region 3 ########################
deploy_region_3:
Expand Down

0 comments on commit 47f0697

Please sign in to comment.