Skip to content

Commit

Permalink
Merge pull request #32 from maticnetwork/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
py-zoid authored Sep 19, 2023
2 parents 3d5fffc + fd4cb52 commit 6532227
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 8 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/staging_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Proof Genarator Staging Deployment
on:
push:
branches: ['dev']
workflow_dispatch:
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: proof-generator-staging-ecr
ECS_SERVICE: proof-generator-staging-ecs-service
ECS_CLUSTER: backend-apis-staging-ecs-cluster
ECS_TASK_DEFINITION: staging-taskdef.json
CONTAINER_NAME: proof-generator-staging


jobs:
deploy:
name: Staging Deployment
permissions:
id-token: write
contents: write
environment: staging
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::070528468658:role/proof-generator-staging-GithubActionsRole
role-session-name: proof-generatorGithubActionsSession
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "Rahul Prabhu <[email protected]>",
"license": "ISC",
"dependencies": {
"@maticnetwork/maticjs": "^3.5.0",
"@maticnetwork/maticjs": "^3.6.6",
"@maticnetwork/maticjs-web3": "^1.0.2",
"compression": "^1.7.4",
"cors": "^2.8.5",
Expand Down
183 changes: 183 additions & 0 deletions staging-taskdef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
{
"requiresCompatibilities": ["FARGATE"],
"inferenceAccelerators": [],
"containerDefinitions": [
{
"dnsSearchDomains": null,
"environmentFiles": [],
"logConfiguration": {
"logDriver": "awsfirelens",
"options": {
"@type": "null"
}
},
"entryPoint": null,
"portMappings": [
{
"hostPort": 5000,
"protocol": "tcp",
"containerPort": 5000
}
],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "PORT",
"value": "5000"
},
{
"name": "NODE_ENV",
"value": "production"
}
],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": null,
"workingDirectory": null,
"secrets": [
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/ETHEREUM_RPC",
"name": "ETHEREUM_RPC"
},
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/GOERLI_RPC",
"name": "GOERLI_RPC"
},
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/MATIC_RPC",
"name": "MATIC_RPC"
},
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/MUMBAI_RPC",
"name": "MUMBAI_RPC"
},
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/SENTRY_DSN",
"name": "SENTRY_DSN"
},
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/ZKEVM_MAINNET_URL",
"name": "ZKEVM_MAINNET_URL"
},
{
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/ZKEVM_TESTNET_URL",
"name": "ZKEVM_TESTNET_URL"
}
],
"dockerSecurityOptions": null,
"memory": null,
"memoryReservation": null,
"volumesFrom": null,
"stopTimeout": null,
"image": "nginx:latest",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "proof-generator-staging",
"repositoryCredentials": {
"credentialsParameter": ""
}
},
{
"name": "log_router_coralogix",
"image": "docker.io/coralogixrepo/fluentd-coralogix-ecs:v1.15.2",
"cpu": 0,
"portMappings": [],
"essential": true,
"environment": [
{
"name": "APP_NAME",
"value": "proof-generator-staging"
},
{
"name": "ENDPOINT",
"value": "api.coralogix.com"
},
{
"name": "log_level",
"value": "error"
},
{
"name": "SUB_SYSTEM",
"value": "proof-generator-staging-subsystem"
}
],
"mountPoints": [],
"volumesFrom": [],
"secrets": [
{
"name": "PRIVATE_KEY",
"valueFrom": "arn:aws:ssm:eu-west-1:070528468658:parameter/proof-generator-staging/CORALOGIX_PRIVATE_KEY"
}
],
"user": "0",
"firelensConfiguration": {
"type": "fluentd",
"options": {
"config-file-type": "file",
"config-file-value": "/fluentd/etc/firelens.conf"
}
}
}
],
"volumes": [],
"networkMode": "awsvpc",
"memory": "2048",
"cpu": "1024",
"executionRoleArn": "arn:aws:iam::070528468658:role/proof-generator-staging-TaskRole",
"family": "proof-generator-staging-taskdefinition",
"taskRoleArn": "arn:aws:iam::070528468658:role/proof-generator-staging-TaskRole",
"runtimePlatform": {
"operatingSystemFamily": "LINUX"
},
"tags": [
{
"key": "Role",
"value": "backend-api"
},
{
"key": "ParentService",
"value": "proof-generator-staging"
},
{
"key": "Environment",
"value": "staging"
},
{
"key": "Service",
"value": "proof-generator-staging.polygon.technology"
},
{
"key": "Host",
"value": "AWS"
},
{
"key": "IAC",
"value": "terraform-workspace-aws-test-applications-eu-west-1-apps-proof-generator-staging-polygon-technology"
},
{
"key": "Team",
"value": "dev-studio-engineering"
},
{
"key": "Name",
"value": "proof-generator-staging-taskdefinition"
}
]
}

0 comments on commit 6532227

Please sign in to comment.