-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (99 loc) · 3.51 KB
/
deploy.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
name: Deploy
on: push
jobs:
testnet:
env:
BRANCH: ${{ github.ref_name }}
NETWORK: testnet
NODE: ${{ secrets.TESTNETNODE }}
MONGOURI: ${{ secrets.TESTNETMONGOURI }}
MONGODATABASENAME: ${{ secrets.TESTNETMONGODATABASENAME }}
MONGOCOLLECTIONCONTRACTS: ${{ secrets.TESTNETMONGOCOLLECTIONCONTRACTS }}
MONGOCOLLECTIONBRANCHES: ${{ secrets.TESTNETMONGOCOLLECTIONBRANCHES }}
COMPARELPSCRIPTADDRESS: 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh # WX/USDN pool
COMPARELPSTABLESCRIPTADDRESS: 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT # USDT/USDN pool
FEESEED: ${{ secrets.TESTNETFEESEED }}
# For Docs
TESTNETNODE: ${{ secrets.TESTNETNODE }}
MAINNETNODE: ${{ secrets.MAINNETNODE }}
TESTNETMONGOURI: ${{ secrets.TESTNETMONGOURI }}
MAINNETMONGOURI: ${{ secrets.MAINNETMONGOURI }}
runs-on: self-hosted
permissions:
contents: write
container:
image: golang:1.19
options: --user 0
steps:
- name: Clean step
uses: mickem/clean-after-action@v1
if: always()
with:
keepGit: true
- name: Check out the repo
uses: actions/checkout@v2
- name: Merge 'main' to '${{ github.ref_name }}' branch
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: ${{ github.ref_name }}
message: Auto-merge 'main' -> '${{ github.ref_name }}'
github_token: ${{ github.token }}
- name: Deploy changed contracts to testnet and update docs
run: |
cd deployer
go run cmd/github-actions-ci/main.go
- name: Commit docs to '_docs' branch
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: _docs
FOLDER: docs
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: Update docs from '${{ github.ref_name }}' branch
- name: Clean repo
uses: AutoModality/action-clean@v1
if: always()
mainnet:
env:
BRANCH: ${{ github.ref_name }}
NETWORK: mainnet
NODE: ${{ secrets.MAINNETNODE }}
MONGOURI: ${{ secrets.MAINNETMONGOURI }}
MONGODATABASENAME: ${{ secrets.MAINNETMONGODATABASENAME }}
MONGOCOLLECTIONCONTRACTS: ${{ secrets.MAINNETMONGOCOLLECTIONCONTRACTS }}
MONGOCOLLECTIONBRANCHES: ${{ secrets.MAINNETMONGOCOLLECTIONBRANCHES }}
COMPARELPSCRIPTADDRESS: 3PCENpEKe8atwELZ7oCSmcdEfcRuKTrUx99 # WX/USDN pool
COMPARELPSTABLESCRIPTADDRESS: 3P8KMyAJCPWNcyedqrmymxaeWonvmkhGauz # USDT/USDN pool
FEESEED: ${{ secrets.MAINNETFEESEED }}
# For Docs
TESTNETNODE: ${{ secrets.TESTNETNODE }}
MAINNETNODE: ${{ secrets.MAINNETNODE }}
TESTNETMONGOURI: ${{ secrets.TESTNETMONGOURI }}
MAINNETMONGOURI: ${{ secrets.MAINNETMONGOURI }}
if: github.ref_name == 'main'
runs-on: self-hosted
container:
image: golang:1.19
options: --user 0
steps:
- name: Clean repo
uses: AutoModality/action-clean@v1
if: always()
- name: Clean step
uses: mickem/clean-after-action@v1
if: always()
with:
keepGit: true
- name: Check out the repo
uses: actions/checkout@v2
- name: Compare contracts and print diff. Deploy changed pools
run: |
cd deployer
go run cmd/github-actions-ci/main.go
- name: Save txs to sign in artifact folder
uses: actions/upload-artifact@v3
with:
name: txs
path: .github/artifacts/txs