Skip to content

Commit 90a8c15

Browse files
committed
mainnet CD pipeline
1 parent 7418589 commit 90a8c15

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: RPC-Gateway Mainnet
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: 'The Release tag Version'
8+
required: false
9+
type: string
10+
11+
12+
env:
13+
AWS_REGION: '${{ secrets.AWS_REGION }}'
14+
ENVIRONMENT: MAINNET
15+
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
16+
REGISTRY: 'ghcr.io'
17+
18+
jobs:
19+
deploy:
20+
name: deploy
21+
runs-on: ubuntu-latest
22+
23+
permissions:
24+
contents: read
25+
id-token: write
26+
actions: write
27+
28+
steps:
29+
- name: checkout the source code
30+
uses: actions/checkout@v4
31+
32+
- name: checkout ecs repo
33+
uses: actions/checkout@v3
34+
with:
35+
repository: sygmaprotocol/devops
36+
token: ${{ secrets.GHCR_TOKEN }}
37+
ref: main
38+
39+
- name: render jinja2 templates to task definition json files
40+
uses: cuchi/[email protected]
41+
with:
42+
template: 'proxy_gateway/ecs/task_definition-${{ env.ENVIRONMENT }}.j2'
43+
output_file: 'proxy_gateway/ecs/task_definition-${{ env.ENVIRONMENT }}.json'
44+
data_format: json
45+
variables: |
46+
awsAccountId=${{ env.AWS_MAINNET }}
47+
awsRegion=${{ env.AWS_REGION }}
48+
awsEnv=${{ env.ENVIRONMENT }}
49+
imageTag=${{ inputs.release_tag }}
50+
51+
- name: Configure AWS Credentials
52+
uses: aws-actions/configure-aws-credentials@v4
53+
with:
54+
role-to-assume: arn:aws:iam::${{ env.AWS_MAINNET }}:role/github-actions-${{ env.ENVIRONMENT }}-sygma
55+
aws-region: ${{ env.AWS_REGION }}
56+
role-session-name: GithubActions
57+
58+
- name: Deploy to Amazon ECS
59+
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
60+
with:
61+
task-definition: 'proxy_gateway/ecs/task_definition-${{ env.ENVIRONMENT }}.json'
62+
service: rpc-service-${{ env.ENVIRONMENT }}
63+
cluster: relayer-${{ env.ENVIRONMENT }}
64+
wait-for-service-stability: true
65+
66+
- name: slack notify
67+
uses: 8398a7/action-slack@v3
68+
with:
69+
status: ${{ job.status }}
70+
fields: repo,message,commit,author,action,job,eventName,ref,workflow
71+
env:
72+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
73+
if: always()

0 commit comments

Comments
 (0)