-
Notifications
You must be signed in to change notification settings - Fork 14
130 lines (121 loc) · 4.71 KB
/
cicd_clis_mainnet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Deploy holoclis to prod2[mainnet]
permissions:
id-token: write
contents: read # This is required for actions/checkout@v2
env:
AWS_REGION: us-west-2
IAM_ROLE: arn:aws:iam::177635894328:role/Github_role_to_access_ECR
ECR_REPOSITORY: holo-cli
#
IMAGE_TAG: mainnet-${{ github.sha }}
#
CLUSTER_NAME: 'prod2'
#
AWS_KEY_ID: ${{ secrets.PROD0_CICD_USER_AWS_ACCESS_KEY_ID }}
AWS_ACCESS_KEY: ${{ secrets.PROD0_CICD_USER_AWS_SECRET_ACCESS_KEY }}
#
# MAINNET_HOLOGRAPH_INDEXER_HOST: 'http://blondie-holo-api.mainnet.svc.cluster.local:443'
# MAINNET_HOLOGRAPH_OPERATOR_HOST: 'http://blondie-holo-api.mainnet.svc.cluster.local:443'
#
MAINNET_HOLO_INDEXER_PASSWORD: ${{ secrets.MAINNET_HOLO_INDEXER_PASSWORD }}
MAINNET_HOLO_OPERATOR_PASSWORD: ${{ secrets.MAINNET_HOLO_OPERATOR_PASSWORD }}
V2_MAINNET_HOLO_OPERATOR_PASSWORD: ${{ secrets.V2_MAINNET_HOLO_OPERATOR_PASSWORD }}
#
# set the RPC endpoints config files
INDEXER_HOLO_CONFIG_FILE_DATA: mainnet-config-file
OPERATOR_HOLO_CONFIG_FILE_DATA: mainnet-config-file
#
HOLOGRAPH_ENVIRONMENT: mainnet
HOLOGRAPH_ADDRESS: ${{ secrets.MAINNET_HOLOGRAPH_ADDRESS }}
BLOCK_PROCESSING_VERSION: 'V2'
#
MAINNET_DOMAIN: 'holograph.xyz' # needed only for the health checks
#
MAINNET_COMMON_NAMESPACE: 'mainnet'
MAINNET_COMMON_NAMESPACE_V2: 'mainnet-v2'
#######################################
MAINNET_HOLO_INDEXER_HELM_CHART_VERSION: 0.1.89
INDEXER_RELEASE_NAME: 'blondie-indexer-mainnet' # format -> [release_name]-indexer-[env]
INDEXER_RELEASE_NAME_V2: 'blondie-indexer-mainnet-v2'
#
MAINNET_HOLO_OPERATOR_HELM_CHART_VERSION: 0.1.21
OPERATOR_RELEASE_NAME: 'blondie-operator-mainnet' # format -> [release_name]-operator-[env]
OPERATOR_RELEASE_NAME_V2: 'blondie-operator-mainnet-v2'
#######################################
## notice: the trigger
#on:
# push:
# branches:
# - 'feat/deploy-mainnet-cli-into-prod2'
# # Excluded branches
# - '!develop'
# - '!main'
# - '!master'
# notice: the trigger
on:
pull_request:
branches:
- 'mainnet'
types: [closed]
jobs:
deploy-to-prod2-mainnet:
if: github.event.pull_request.merged == true # so no workflow runs when some PR is just closed without being merged
name: Deploy-on-mainnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
#
- name: Initial Setup [composite action]
uses: ./.github/actions/mainnet/initial-setup
# --- Notice: V1 ---
- name: Deploy V1 Indexer [composite action]
uses: ./.github/actions/mainnet/deploy-v1-indexer
#
- name: Pause for 60 seconds
shell: bash
run: sleep 60
#
- name: Deploy V1 Operator [composite action]
uses: ./.github/actions/mainnet/deploy-v1-operator
#
- name: -> V1 -- Info for the new V1 deployments
uses: tensor-hq/eksctl-helm-action@main
env:
INDEXER_RELEASE_NAME: ${{ env.INDEXER_RELEASE_NAME }}
OPERATOR_RELEASE_NAME: ${{ env.OPERATOR_RELEASE_NAME }}
with:
eks_cluster: ${{ env.CLUSTER_NAME }}
command: |-
echo "------------------------- Last n Helm releases -------------------------"
echo "--INDEXER--"
helm history $INDEXER_RELEASE_NAME -n ${{ env.MAINNET_COMMON_NAMESPACE }} --max 3
echo "--OPERATOR--"
helm history $OPERATOR_RELEASE_NAME -n ${{ env.MAINNET_COMMON_NAMESPACE }} --max 3
echo "------------------------ Newly deployed image [same for all clis] ------------------------ "
echo "$IMAGE_TAG"
# --- Notice: V2 ---
- name: Deploy V2 Indexer [composite action]
uses: ./.github/actions/mainnet/deploy-v2-indexer
#
- name: Pause for 60 seconds
shell: bash
run: sleep 60
#
- name: Deploy V2 Operator [composite action]
uses: ./.github/actions/mainnet/deploy-v2-operator
#
- name: -> V2 -- Info for the new V2 deployments
uses: tensor-hq/eksctl-helm-action@main
env:
INDEXER_RELEASE_NAME: ${{ env.INDEXER_RELEASE_NAME_V2 }}
OPERATOR_RELEASE_NAME: ${{ env.OPERATOR_RELEASE_NAME_V2 }}
with:
eks_cluster: ${{ env.CLUSTER_NAME }}
command: |-
echo "------------------------- Last n Helm releases -------------------------"
echo "--V2 INDEXER--"
helm history $INDEXER_RELEASE_NAME -n ${{ env.MAINNET_COMMON_NAMESPACE_V2 }} --max 3
echo "--V2 OPERATOR--"
helm history $OPERATOR_RELEASE_NAME -n ${{ env.MAINNET_COMMON_NAMESPACE_V2 }} --max 3
echo "------------------------ Newly deployed image [same for all apps] ------------------------"
echo "$IMAGE_TAG"