-
Notifications
You must be signed in to change notification settings - Fork 113
38 lines (32 loc) · 1.46 KB
/
deploy-on-qa2.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
name: Deploy zkbnb on qa2
on:
push:
branches:
- qa2
jobs:
deploy:
runs-on: [self-hosted,zkbas]
permissions:
issues: write
pull-requests: write
steps:
- name: Deploy new zkbnb on qa2
run: |
echo 'fetch zkbnb repo'
export BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
cd ~
rm -rf ./zkbnb
git clone --branch qa2 https://github.com/bnb-chain/zkbnb.git
cd ./zkbnb
sudo scp -r ./deploy-qa.sh "qa2:/tmp/"
sudo ssh qa2 "sudo bash -x /tmp/deploy-qa.sh qa2;exit"
echo "end deploy on qa2"
- name: Notification via slack
run: |
export SLACK_WEBHOOK_URL=`sudo cat /home/ec2-user/actions-runner/slack-config.json | jq -r '.slack'`
export JOB_STATUS=${{ job.status }}
sudo scp -r qa2:/root/zkbnb-deploy/zkbnb-contract/info/addresses.json ~/addresses.json
export ZkBNB=`sudo cat ~/addresses.json | jq -r '.zkbnbProxy'`
export AssetGov=`sudo cat ~/addresses.json | jq -r '.assetGovernance'`
curl -X POST $SLACK_WEBHOOK_URL --header 'Content-Type: application/json' \
--data-raw '{ "author": "@'$GITHUB_ACTOR'", "status": "'$JOB_STATUS'", "ref": "'$GITHUB_REF'", "event": "'$GITHUB_EVENT_NAME'", "url": "'$GITHUB_SERVER_URL'/'$GITHUB_REPOSITORY'/commit/'$GITHUB_SHA'/checks", "ZkBNBContract": "'$ZkBNB'", "AssetGovContract": "'$AssetGov'" }'