forked from Cardinal-Cryptography/aleph-node
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 3.48 KB
/
deploy-to-devnet.yml
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
name: Deploy to Devnet
on:
workflow_run:
workflows: ["e2e-tests-main-devnet"]
branches:
- main
types:
- completed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
jobs:
deploy-devnet:
if: github.event.workflow_run.conclusion == 'success'
name: Deploy new aleph-node image to EKS
environment:
name: devnet
runs-on: ubuntu-latest
env:
AWS_REGION: us-east-1 # this region is used by all public ECR repos
steps:
- name: GIT | Checkout
uses: actions/checkout@v2
- name: GIT | Get branch info & current commit sha.
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Public Amazon ECR
id: login-public-ecr
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1
- name: GIT | Checkout aleph-apps repo
uses: actions/checkout@master
with:
repository: Cardinal-Cryptography/aleph-apps
token: ${{ secrets.CI_GH_TOKEN }}
path: "aleph-apps"
- name: Init kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.8.6"
- name: Update aleph-node docker image and trigger ArgoCD deploy for Devnet
env:
RELEASE_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node:${{ steps.vars.outputs.sha_short }}
REGIONS_AWS: 'eu-central-1'
run: |
IFS="," read -a region_array <<< ${{ env.REGIONS_AWS }}
export aleph_path=$(pwd)
for i in "${region_array[@]}"; do
# Deploy new image version for validator
cd ${aleph_path}/aleph-apps/aleph-node-validators/overlays/devnet/${i}
kustomize edit set image "aleph-node-validator-image-placeholder=${{ env.RELEASE_IMAGE }}"
done
- name: GIT | Commit changes to aleph-apps repository.
uses: EndBug/[email protected]
with:
author_name: AlephZero Automation
author_email: [email protected]
message: "Updating Devnet docker image tag to: ${{ steps.vars.outputs.sha_short }}"
add: "*.yaml"
cwd: "aleph-apps"
branch: main
env:
GITHUB_TOKEN: ${{ secrets.CI_GH_TOKEN }}
- name: Send Slack Notification
uses: rtCamp/action-slack-notify@v2
continue-on-error: true
env:
SLACK_COLOR: ${{ job.status }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: GithubActions
SLACK_TITLE: deploy-devnet-new-test job has finished
MSG_MINIMAL: actions url