Skip to content

Commit

Permalink
Adding deploy-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
IPadawans committed Oct 5, 2023
1 parent 48120d2 commit 48ccbae
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 14 deletions.
39 changes: 39 additions & 0 deletions .github/templates/deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy

inputs:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_REGION:
required: true
AWS_LAMBDA_FUNCTION_NAME:
required: true

runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Install AWS Cli
uses: unfor19/install-aws-cli-action@v1
with:
arch: amd64
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install jq
shell: bash
run: |
npm run package
- name: Upload lambda code
env:
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ inputs.AWS_REGION }}
shell: bash
run: |
aws lambda update-function-code \
--function-name ${{ inputs.AWS_LAMBDA_FUNCTION_NAME }} \
--zip-file fileb://my_deployment_package.zip
19 changes: 19 additions & 0 deletions .github/workflows/deploy-dor-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy Dor AWS

on:
push:
branches:
- "deploy/dor-aws"
jobs:
deploy-dor-aws:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Deploy DOR AWS
uses: "./.github/templates/deploy"
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DOR }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DOR }}
AWS_REGION: ${{ secrets.AWS_REGION_DOR}}
AWS_LAMBDA_FUNCTION_NAME: MetagraphMonitor
19 changes: 19 additions & 0 deletions .github/workflows/deploy-lattice-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy Lattice AWS

on:
push:
branches:
- "deploy/lattice-aws"
jobs:
deploy-lattice-aws:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Deploy Lattice AWS
uses: "./.github/templates/deploy"
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_LATTICE }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_LATTICE }}
AWS_REGION: ${{ secrets.AWS_REGION_LATTICE}}
AWS_LAMBDA_FUNCTION_NAME: DORMetagraphMonitor
19 changes: 19 additions & 0 deletions .github/workflows/deploy-testnet-integrationnet-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy Testnet/Integrationnet AWS

on:
push:
branches:
- "deploy/testnet-integrationnet-aws"
jobs:
deploy-testnet-integrationnet-aws:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Deploy Testnet/Integrationnet AWS
uses: "./.github/templates/deploy"
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_TESTNET_INTEGRATIONNET }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_TESTNET_INTEGRATIONNET }}
AWS_REGION: ${{ secrets.AWS_REGION_TESTNET_INTEGRATIONNET }}
AWS_LAMBDA_FUNCTION_NAME: MetagraphMonitor
29 changes: 15 additions & 14 deletions event.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"network": "integrationnet",
"metagraph_id": "DAG5Q12Zb5UraXyGSUM3sZBkxJyyN3uRBWEvhMeU",
"metagraph_name": "DOR",
"region":"us-west-2",
"network": ":network_name",
"metagraph_id": ":metagraph_id",
"metagraph_name": ":metagraph_name",

"base_metagraph_l0_directory": "/home/ubuntu/code/metagraph-l0",
"base_currency_l1_directory": "/home/ubuntu/code/currency-l1",
"base_data_l1_directory": "/home/ubuntu/code/data-l1",
"cl_app_env": "integrationnet",

"cl_app_env": ":network_name",
"cl_collateral": 0,

"include_currency_l1_layer": true,
Expand All @@ -25,17 +25,18 @@
"data_l1_p2p_port": 9001,
"data_l1_cli_port": 9002,

"ec2_instance_1_id": "i-03b3276264675e661",
"ec2_instance_1_ip": "54.218.46.24",
"region":":aws_region",
"ec2_instance_1_id": ":ec2_instance_1_id",
"ec2_instance_1_ip": ":ec2_instance_1_ip",

"ec2_instance_2_id": "i-074aabc2ebd03819b",
"ec2_instance_2_ip": "34.212.237.118",
"ec2_instance_2_id": ":ec2_instance_2_id",
"ec2_instance_2_ip": ":ec2_instance_2_ip",

"ec2_instance_3_id": "i-0cc80924a8124f3e6",
"ec2_instance_3_ip": "34.219.123.201",
"ec2_instance_3_id": ":ec2_instance_3_id",
"ec2_instance_3_ip": ":ec2_instance_2_ip",

"network_global_l0_ip": "3.101.147.116",
"network_global_l0_port": 9000,
"network_global_l0_id": "e2f4496e5872682d7a55aa06e507a58e96b5d48a5286bfdff7ed780fa464d9e789b2760ecd840f4cb3ee6e1c1d81b2ee844c88dbebf149b1084b7313eb680714"
"network_global_l0_ip": ":network_l0_node_ip",
"network_global_l0_port": ":network_l0_node_port",
"network_global_l0_id": ":network_l0_node_id"

}

0 comments on commit 48ccbae

Please sign in to comment.