Skip to content

Commit

Permalink
rpc testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eedygreen committed Mar 11, 2024
1 parent f3f87c3 commit f8d9093
Showing 1 changed file with 121 additions and 0 deletions.
121 changes: 121 additions & 0 deletions .github/workflows/gateway_testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

name: RPC-Gateway Testnet

on:
release:
types:
- published
push:
branches:
- rpc


env:
ENVIRONMENT: 'TESTNET'
REGISTRY: 'ghcr.io'
TAG: 'stable'
AWS_TESTNET: '${{ secrets.AWS_ARN }}'

jobs:
push:
name: push
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: login to ghcr
id: ghcr
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: build / tag / push docker image into ghcr
id: build-and-push-tag
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG }}

- name: tag version / push docker image into ghcr
id: build-and-push-ref
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}


# - name: slack notify
# uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,action,job,eventName,ref,workflow
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# if: always()


deploy:
needs: push
name: deploy
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- 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/[email protected]
with:
template: 'proxy_gateway/ecs/task_definition-${{ env.ENVIRONMENT }}.j2'
output_file: 'proxy_gateway/ecs/task_definition-${{ env.ENVIRONMENT }}.json'
data_format: json
variables: |
awsAccountId=${{ env.AWS_TESTNET }}
awsRegion=${{ secrets.AWS_REGION }}
awsEfs=${{ secrets.TESTNET_RPC_EFS }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_TESTNET }}: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: 'proxy_gateway/ecs/task_definition-${{ env.ENVIRONMENT }}.json'
service: 'rpc-gateway-service-${{ env.ENVIRONMENT }}'
cluster: 'relayer-${{ env.ENVIRONMENT }}'
wait-for-service-stability: true

# - name: slack notify
# uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,action,job,eventName,ref,workflow
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# if: always()

0 comments on commit f8d9093

Please sign in to comment.