Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/012-Blondie-v10-testnet #670

Merged
merged 52 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e5d64cd
test the separate jobs
Mar 22, 2024
7c57bc9
test the common aws creds job
Mar 22, 2024
192e368
test the common aws creds job
Mar 22, 2024
b342728
test the common aws creds job
Mar 22, 2024
1c23e8c
test the common aws creds job
Mar 22, 2024
bf8399a
test the common aws creds job
Mar 22, 2024
a46f9cb
test the common aws creds job
Mar 22, 2024
3b4fdac
test the common aws creds job
Mar 22, 2024
47de0e2
test the common aws creds job
Mar 22, 2024
3e1dc6b
test the common aws creds job
Mar 22, 2024
d784594
test the common aws creds job
Mar 22, 2024
e7d33c6
test the common aws creds job
Mar 22, 2024
164c1c4
test the common aws creds job
Mar 22, 2024
4047477
test the common aws creds job
Mar 22, 2024
f09abd5
test the common aws creds job
Mar 22, 2024
a63ec66
try parallel runs
Mar 22, 2024
25a6c7d
ready for PR
Mar 22, 2024
55202c2
test the cicd
Mar 28, 2024
c3754cf
test the cicd
Mar 28, 2024
c9694a4
test the cicd
Mar 28, 2024
5c8c919
test the cicd
Mar 28, 2024
f0cca53
test the cicd
Mar 28, 2024
2e3d19b
test the cicd
Mar 29, 2024
d96ccf7
test the cicd
Mar 29, 2024
cf094de
test the cicd
Mar 29, 2024
6be523c
test the cicd
Mar 29, 2024
d91a6bf
test the cicd
Mar 29, 2024
d4fc010
test the cicd
Mar 29, 2024
0374a85
test the cicd
Mar 29, 2024
5018378
test the cicd
Mar 29, 2024
b114328
test the cicd
Mar 29, 2024
68f296d
test the cicd
Mar 29, 2024
9607f1b
ready for PR
Mar 29, 2024
582813e
Merge branch 'develop' into feat/separate-v1-v2-cli-cicd
Mar 29, 2024
47bdd98
added the last step for check
Mar 29, 2024
10069dd
added composite cicds for testnet
Mar 29, 2024
6562cf9
set composite actions for testnet/mainnet cicds
Apr 1, 2024
bc59d92
Merge pull request #661 from holographxyz/feat/separate-v1-v2-cli-cicd
sogoiii Apr 1, 2024
bf657b7
add docs, update version. no longer use network short names
sogoiii Apr 3, 2024
ecb2838
replaced fuji/mumbai short names
Apr 3, 2024
5581c3d
Merge pull request #665 from holographxyz/feat/remove-fuji-mumbai-sho…
sogoiii Apr 4, 2024
7dcd476
Merge pull request #664 from holographxyz/hotfix/update-readme-and-ve…
sogoiii Apr 4, 2024
e31a6d1
add support to ERC20 CrossChainMessageType
BravoNatalie Apr 15, 2024
fbacc53
add requested changes
BravoNatalie Apr 15, 2024
832a580
Merge pull request #666 from holographxyz/feature/holo-1466-add-htoke…
BravoNatalie Apr 16, 2024
b0ec0d9
remove ERC20_HLG cross chain message type
BravoNatalie Apr 19, 2024
06a7016
add min gas price to binanceSmartChainTestnet
BravoNatalie May 8, 2024
e115290
Merge pull request #668 from holographxyz/hotfix/fix-bnb-min-gas-price
sogoiii May 8, 2024
6b9d7fb
Merge pull request #667 from holographxyz/hotfix/remove-erc20-hlg-mes…
sogoiii May 15, 2024
5d9b418
set min gas for bnb, check balances map updated, retry logic exits qu…
sogoiii Feb 29, 2024
b0c55fe
apply prettier
sogoiii May 29, 2024
e669660
Merge pull request #638 from holographxyz/hotfix/set-min-gas-for-bnb
sogoiii May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions .github/actions/develop/deploy-indexer/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: 'deploy-indexer'
runs:
using: 'composite'
steps:
- name: -> V2 -- Deploy INDEXER cli in staging [namespace -> ${{ env.STG_COMMON_NAMESPACE_V2 }}]
uses: tensor-hq/eksctl-helm-action@main
env:
RELEASE_NAME: ${{ env.INDEXER_RELEASE_NAME_V2 }} # notice
HOLOGRAPH_VERSION: 'V2'
#
ENABLE_DEBUG: 'true'
HEALTHCHECK: 'true'
MODE: 'auto'
ENABLE_UNSAFE: 'false'
ENABLE_SYNC: 'true'
ENABLE_PROCESS_BLOCK_RANGE: 'true' # undefined/true
UPDATE_BLOCK_HEIGHT: 'api' # api/file/disable
#
ENABLE_PROCESS_BLOCK_RANGE_arbitrum: 'true' # undefined/true
ENABLE_PROCESS_BLOCK_RANGE_optimism: 'true'
ENABLE_PROCESS_BLOCK_RANGE_binance: 'true'
ENABLE_PROCESS_BLOCK_RANGE_mantle: 'true'
ENABLE_PROCESS_BLOCK_RANGE_zora: 'true'
ENABLE_PROCESS_BLOCK_RANGE_avalanche: 'true'
ENABLE_PROCESS_BLOCK_RANGE_ethereum: 'true'
ENABLE_PROCESS_BLOCK_RANGE_polygon: 'true'
ENABLE_PROCESS_BLOCK_RANGE_base: 'true'
ENABLE_PROCESS_BLOCK_RANGE_linea: 'true'
#
AVALANCHE_NETWORK: 'avalancheTestnet'
POLYGON_NETWORK: '{polygonTestnet}'
BINANCE_NETWORK: 'binanceSmartChainTestnet'
MANTLE_NETWORK: '{mantleTestnet}'
ETHEREUM_NETWORK: '{ethereumTestnetSepolia}'
OPTIMISM_NETWORK: '{optimismTestnetSepolia}'
ARBITRUM_NETWORK: '{arbitrumTestnetSepolia}'
ZORA_NETWORK: '{zoraTestnetSepolia}'
BASE_NETWORK: '{baseTestnetSepolia}'
LINEA_NETWORK: '{lineaTestnetGoerli}'
with:
eks_cluster: ${{ env.CLUSTER_NAME }}
command: |-
helm upgrade --install $RELEASE_NAME \
holo-indexer-${{ env.STG_HOLOGRAPH_INDEXER_HELM_CHART_VERSION }}.tgz \
-n ${{ env.STG_COMMON_NAMESPACE_V2 }} \
\
--set dummy_deployment_namespace=dev-cli-dummies \
\
--set image.repository=${{ env.ECR_REPOSITORY }} \
--set image.image_tag=${{ env.IMAGE_TAG }} \
--set config_file_data=${{ env.INDEXER_HOLOGRAPH_CONFIG_FILE_DATA }} \
--set holo_indexer_password=$DEV_INDEXER_V2_PASSWORD \
--set HOLO_INDEXER_HOST=$DEV_INDEXER_V2_HOLO_INDEXER_HOST \
--set OPERATOR_API_KEY=$DEV_INDEXER_V2_OPERATOR_API_KEY \
--set HOLOGRAPH_ENVIRONMENT=${{ env.HOLOGRAPH_ENVIRONMENT }} \
--set HOLOGRAPH_ADDRESS=$DEV_INDEXER_V2_HOLOGRAPH_ADDRESS \
--set HOLOGRAPH_VERSION=${{ env.HOLOGRAPH_VERSION }} \
--set BLOCK_PROCESSING_VERSION=${{ env.BLOCK_PROCESSING_VERSION }} \
\
--set ENABLE_DEBUG=$ENABLE_DEBUG \
--set ENABLE_SYNC=$ENABLE_SYNC \
--set HEALTHCHECK=$HEALTHCHECK \
--set MODE=$MODE \
\
--set AVALANCHE_NETWORK="${AVALANCHE_NETWORK}" \
--set POLYGON_NETWORK="${POLYGON_NETWORK}" \
--set BINANCE_NETWORK="${BINANCE_NETWORK}" \
--set MANTLE_NETWORK="${MANTLE_NETWORK}" \
--set ETHEREUM_NETWORK="${ETHEREUM_NETWORK}" \
--set OPTIMISM_NETWORK="${OPTIMISM_NETWORK}" \
--set ARBITRUM_NETWORK="${ARBITRUM_NETWORK}" \
--set ZORA_NETWORK="${ZORA_NETWORK}" \
--set BASE_NETWORK="${BASE_NETWORK}" \
--set LINEA_NETWORK="${LINEA_NETWORK}" \
\
--set ENABLE_UNSAFE="${ENABLE_UNSAFE}" \
--set UPDATE_BLOCK_HEIGHT=$UPDATE_BLOCK_HEIGHT \
\
--set ENABLE_PROCESS_BLOCK_RANGE.arbitrum=$ENABLE_PROCESS_BLOCK_RANGE_arbitrum \
--set ENABLE_PROCESS_BLOCK_RANGE.binance=$ENABLE_PROCESS_BLOCK_RANGE_binance \
--set ENABLE_PROCESS_BLOCK_RANGE.avalanche=$ENABLE_PROCESS_BLOCK_RANGE_avalanche \
--set ENABLE_PROCESS_BLOCK_RANGE.optimism=$ENABLE_PROCESS_BLOCK_RANGE_optimism \
--set ENABLE_PROCESS_BLOCK_RANGE.ethereum=$ENABLE_PROCESS_BLOCK_RANGE_ethereum \
--set ENABLE_PROCESS_BLOCK_RANGE.polygon=$ENABLE_PROCESS_BLOCK_RANGE_polygon \
--set ENABLE_PROCESS_BLOCK_RANGE.mantle=$ENABLE_PROCESS_BLOCK_RANGE_mantle \
--set ENABLE_PROCESS_BLOCK_RANGE.zora=$ENABLE_PROCESS_BLOCK_RANGE_zora \
--set ENABLE_PROCESS_BLOCK_RANGE.base=$ENABLE_PROCESS_BLOCK_RANGE_base \
--set ENABLE_PROCESS_BLOCK_RANGE.linea=$ENABLE_PROCESS_BLOCK_RANGE_linea \
\
--set dev_rpc_config_values.avalancheTestnet_rpc_url=$DEV_INDEXER_V2_AVALANCHE_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnet_rpc_url=$DEV_INDEXER_V2_POLYGON_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnetAmoy_rpc_url=$DEV_INDEXER_V2_POLYGON_TESTNET_AMOY_RPC_URL \
--set dev_rpc_config_values.binanceTestnet_rpc_url=$DEV_INDEXER_V2_BINANCE_SMART_CHAIN_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnet_rpc_url=$DEV_INDEXER_V2_MANTLE_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnetSepolia_rpc_url=$DEV_INDEXER_V2_MANTLE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.ethereumTestnetSepolia_rpc_url=$DEV_INDEXER_V2_ETHEREUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.optimismTestnetSepolia_rpc_url=$DEV_INDEXER_V2_OPTIMISM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.arbitrumTestnetSepolia_rpc_url=$DEV_INDEXER_V2_ARBITRUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.zoraTestnetSepolia_rpc_url=$DEV_INDEXER_V2_ZORA_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.baseTestnetSepolia_rpc_url=$DEV_INDEXER_V2_BASE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.lineaTestnetGoerli_rpc_url=$DEV_INDEXER_V2_LINEA_TESTNET_GOERLI_RPC_URL \
--set dev_rpc_config_values.lineaTestnetSepolia_rpc_url=$DEV_INDEXER_V2_LINEA_TESTNET_SEPOLIA_RPC_URL \
\
--set dev_rpc_config_values.private_key=$DEV_INDEXER_V2_PRIVATE_KEY \
--set dev_rpc_config_values.address=$DEV_INDEXER_V2_DEV_WALLET_ADDRESS \
--set dev_rpc_config_values.version="beta3" \
\
--set datadog_tags.env=${{ env.CLUSTER_NAME }} \
--set datadog_tags.service=$RELEASE_NAME \
--set datadog_tags.version=$RELEASE_NAME-${{ env.STG_HOLOGRAPH_INDEXER_HELM_CHART_VERSION }} \
\
--set autoscaling.enabled=false \
--set replicaCountAvalanche=1 \
--set replicaCountPolygon=1 \
--set replicaCountBinance=1 \
--set replicaCountMantle=1 \
--set replicaCountEthereum=1 \
--set replicaCountArbitrum=1 \
--set replicaCountOptimism=1 \
--set replicaCountBase=1 \
--set replicaCountLinea=1 \
--set replicaCountZora=1 \
\
--set sqs.SQS_USER_AWS_ACCESS_KEY_ID=$COMMON_AWS_ACCESS_KEY_ID_SQS \
--set sqs.SQS_USER_AWS_SECRET_ACCESS_KEY=$COMMON_AWS_SECRET_ACCESS_KEY_SQS \
--set sqs.SQS_ENDPOINT=$DEV_INDEXER_V2_SQS_ENDPOINT \
--set sqs.SQS_QUEUE_URL=$DEV_INDEXER_V2_SQS_QUEUE_URL \
--set sqs.AWS_REGION=$COMMON_AWS_REGION
119 changes: 119 additions & 0 deletions .github/actions/develop/deploy-operator/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: 'deploy-operator'
runs:
using: 'composite'
steps:
- name: -> V2 -- Deploy OPERATOR cli in staging [namespace -> ${{ env.STG_COMMON_NAMESPACE_V2 }}]
uses: tensor-hq/eksctl-helm-action@main
env:
RELEASE_NAME: ${{ env.OPERATOR_RELEASE_NAME_V2 }} # notice
HOLOGRAPH_VERSION: 'V2'
#
ENABLE_DEBUG: 'true'
ENABLE_SYNC: 'true'
HEALTHCHECK: 'true'
MODE: 'auto'
ENABLE_UNSAFE: 'false'
ENABLE_PROCESS_BLOCK_RANGE: 'true' # undefined/true
UPDATE_BLOCK_HEIGHT: 'api' # api/file/disable
#
ENABLE_PROCESS_BLOCK_RANGE_arbitrum: 'true' # undefined/true
ENABLE_PROCESS_BLOCK_RANGE_optimism: 'true'
ENABLE_PROCESS_BLOCK_RANGE_binance: 'true'
ENABLE_PROCESS_BLOCK_RANGE_mantle: 'true'
ENABLE_PROCESS_BLOCK_RANGE_zora: 'true'
ENABLE_PROCESS_BLOCK_RANGE_avalanche: 'true'
ENABLE_PROCESS_BLOCK_RANGE_ethereum: 'true'
ENABLE_PROCESS_BLOCK_RANGE_polygon: 'true'
ENABLE_PROCESS_BLOCK_RANGE_base: 'true'
ENABLE_PROCESS_BLOCK_RANGE_linea: 'true'
#
AVALANCHE_NETWORK: 'avalancheTestnet'
POLYGON_NETWORK: '{polygonTestnet}'
BINANCE_NETWORK: 'binanceSmartChainTestnet'
MANTLE_NETWORK: '{mantleTestnet}'
ETHEREUM_NETWORK: '{ethereumTestnetSepolia}'
OPTIMISM_NETWORK: '{optimismTestnetSepolia}'
ARBITRUM_NETWORK: '{arbitrumTestnetSepolia}'
ZORA_NETWORK: '{zoraTestnetSepolia}'
BASE_NETWORK: '{baseTestnetSepolia}'
LINEA_NETWORK: '{lineaTestnetGoerli}'
with:
eks_cluster: ${{ env.CLUSTER_NAME }}
command: |-
helm upgrade --install $RELEASE_NAME \
holo-operator-${{ env.STG_HOLOGRAPH_OPERATOR_HELM_CHART_VERSION }}.tgz \
-n ${{ env.STG_COMMON_NAMESPACE_V2 }} \
\
--set dummy_deployment_namespace=dev-cli-dummies \
\
--set image.repository=${{ env.ECR_REPOSITORY }} \
--set image.image_tag=${{ env.IMAGE_TAG }} \
--set config_file_data=${{ env.OPERATOR_HOLOGRAPH_CONFIG_FILE_DATA }} \
--set holo_operator_password=$DEV_OPERATOR_V2_PASSWORD \
--set HOLO_OPERATOR_HOST=$DEV_OPERATOR_V2_HOLO_OPERATOR_HOST \
--set OPERATOR_API_KEY=$DEV_OPERATOR_V2_OPERATOR_API_KEY \
--set HOLOGRAPH_ENVIRONMENT=${{ env.HOLOGRAPH_ENVIRONMENT }} \
--set HOLOGRAPH_ADDRESS=$DEV_OPERATOR_V2_HOLOGRAPH_ADDRESS \
--set HOLOGRAPH_VERSION=${{ env.HOLOGRAPH_VERSION }} \
\
--set ENABLE_DEBUG=$ENABLE_DEBUG \
--set ENABLE_SYNC=$ENABLE_SYNC \
--set HEALTHCHECK=$HEALTHCHECK \
--set MODE=$MODE \
--set ENABLE_UNSAFE="${ENABLE_UNSAFE}" \
--set UPDATE_BLOCK_HEIGHT=$UPDATE_BLOCK_HEIGHT \
\
--set ENABLE_PROCESS_BLOCK_RANGE.arbitrum=$ENABLE_PROCESS_BLOCK_RANGE_arbitrum \
--set ENABLE_PROCESS_BLOCK_RANGE.binance=$ENABLE_PROCESS_BLOCK_RANGE_binance \
--set ENABLE_PROCESS_BLOCK_RANGE.avalanche=$ENABLE_PROCESS_BLOCK_RANGE_avalanche \
--set ENABLE_PROCESS_BLOCK_RANGE.optimism=$ENABLE_PROCESS_BLOCK_RANGE_optimism \
--set ENABLE_PROCESS_BLOCK_RANGE.ethereum=$ENABLE_PROCESS_BLOCK_RANGE_ethereum \
--set ENABLE_PROCESS_BLOCK_RANGE.polygon=$ENABLE_PROCESS_BLOCK_RANGE_polygon \
--set ENABLE_PROCESS_BLOCK_RANGE.mantle=$ENABLE_PROCESS_BLOCK_RANGE_mantle \
--set ENABLE_PROCESS_BLOCK_RANGE.zora=$ENABLE_PROCESS_BLOCK_RANGE_zora \
--set ENABLE_PROCESS_BLOCK_RANGE.base=$ENABLE_PROCESS_BLOCK_RANGE_base \
--set ENABLE_PROCESS_BLOCK_RANGE.linea=$ENABLE_PROCESS_BLOCK_RANGE_linea \
\
--set AVALANCHE_NETWORK="${AVALANCHE_NETWORK}" \
--set POLYGON_NETWORK="${POLYGON_NETWORK}" \
--set BINANCE_NETWORK="${BINANCE_NETWORK}" \
--set MANTLE_NETWORK="${MANTLE_NETWORK}" \
--set ETHEREUM_NETWORK="${ETHEREUM_NETWORK}" \
--set OPTIMISM_NETWORK="${OPTIMISM_NETWORK}" \
--set ARBITRUM_NETWORK="${ARBITRUM_NETWORK}" \
--set ZORA_NETWORK="${ZORA_NETWORK}" \
--set BASE_NETWORK="${BASE_NETWORK}" \
--set LINEA_NETWORK="${LINEA_NETWORK}" \
\
--set dev_rpc_config_values.avalancheTestnet_rpc_url=$DEV_OPERATOR_V2_AVALANCHE_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnet_rpc_url=$DEV_OPERATOR_V2_POLYGON_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnetAmoy_rpc_url=$DEV_OPERATOR_V2_POLYGON_TESTNET_AMOY_RPC_URL \
--set dev_rpc_config_values.binanceTestnet_rpc_url=$DEV_OPERATOR_V2_BINANCE_SMART_CHAIN_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnet_rpc_url=$DEV_OPERATOR_V2_MANTLE_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_MANTLE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.ethereumTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_ETHEREUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.optimismTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_OPTIMISM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.arbitrumTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_ARBITRUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.zoraTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_ZORA_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.baseTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_BASE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.lineaTestnetGoerli_rpc_url=$DEV_OPERATOR_V2_LINEA_TESTNET_GOERLI_RPC_URL \
--set dev_rpc_config_values.lineaTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_LINEA_TESTNET_SEPOLIA_RPC_URL \
\
--set dev_rpc_config_values.private_key=$DEV_OPERATOR_V2_PRIVATE_KEY \
--set dev_rpc_config_values.address=$DEV_OPERATOR_V2_DEV_WALLET_ADDRESS \
\
--set autoscaling.enabled=false \
--set replicaCountAvalanche=1 \
--set replicaCountPolygon=1 \
--set replicaCountBinance=1 \
--set replicaCountMantle=1 \
--set replicaCountEthereum=1 \
--set replicaCountArbitrum=1 \
--set replicaCountOptimism=1 \
--set replicaCountBase=1 \
--set replicaCountLinea=1 \
--set replicaCountZora=1 \
\
--set datadog_tags.env=${{ env.CLUSTER_NAME }} \
--set datadog_tags.service=$RELEASE_NAME \
--set datadog_tags.version=$RELEASE_NAME-${{ env.STG_HOLOGRAPH_OPERATOR_HELM_CHART_VERSION }}
90 changes: 90 additions & 0 deletions .github/actions/develop/initial-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 'initial-setup'
runs:
using: 'composite'
steps:
- name: Use Githubs federated identity with AWS
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.IAM_ROLE }}
aws-region: ${{ env.AWS_REGION }}

- name: Get secrets from AWS Secrets Manager
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
aws-region: ${{ env.AWS_REGION }}
secret-ids: |
DEV_INDEXER_V2
DEV_OPERATOR_V2
COMMON
parse-json-secrets: true # to be able to get the json k/v pairs

- name: Login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Checkout the code
uses: actions/checkout@v4

# This is a separate action that sets up buildx runner
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

# So now you can use Actions' own caching!
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx

# And make it available for builds
- name: Build image
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
build-args: AWS_ECR_URL=${{ steps.login-ecr.outputs.registry }}
platforms: linux/amd64
tags: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true # set false to deactivate the push to ECR

# This ugly bit is necessary if you don't want your cache to grow forever until it hits GitHub's limit of 5GB.
# https://github.com/docker/build-push-action/issues/252 & https://github.com/moby/buildkit/issues/1896
- name: Move cache
shell: bash
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

- name: Configure AWS creds to access EKS
# TIP: the deployment user must be in the masters group in the aws-auth config map in the cluster
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_KEY_ID }} #notice: unique for each env
aws-secret-access-key: ${{ env.AWS_ACCESS_KEY }} #notice: unique for each env
aws-region: ${{ env.AWS_REGION }}

# NOTICE: --- INDEXER ---
- name: Pull the holograph-indexer helm chart version x.x.x from ECR
shell: bash
env:
CHART_REPO: holo-indexer
CHART_VERSION: ${{ env.STG_HOLOGRAPH_INDEXER_HELM_CHART_VERSION }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
helm pull oci://$ECR_REGISTRY/$CHART_REPO --version $CHART_VERSION

# NOTICE: --- OPERATOR ---
- name: Pull the holograph-operator helm chart version x.x.x from ECR
shell: bash
env:
CHART_REPO: holo-operator
CHART_VERSION: ${{ env.STG_HOLOGRAPH_OPERATOR_HELM_CHART_VERSION }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
helm pull oci://$ECR_REGISTRY/$CHART_REPO --version $CHART_VERSION
Loading
Loading