-
Notifications
You must be signed in to change notification settings - Fork 16
174 lines (172 loc) · 6.14 KB
/
deploy_fleek.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Deploy fleek
on:
push:
branches:
- "develop"
- "master"
- "testing-deployment"
jobs:
build-deploy-mainnet:
runs-on: ubuntu-latest
container: fleek/create-react-app:node-15
if: github.ref == 'refs/heads/master'
environment: MAINNET
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14
- name: install dependencies
run: yarn install
- name: lint
run: yarn lint
- name: build app
env:
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }}
REACT_APP_DEPLOY_VERSION: ${{ github.sha }}
REACT_APP_DEPLOY_ENVIRONMENT: production
REACT_APP_CHAIN_ID: 1
REACT_APP_ETHERSCAN_ENDPOINT: ${{ secrets.REACT_APP_ETHERSCAN_ENDPOINT }}
run: yarn build
- name: Activate mainnet's fleek
run: mv .github/fleek/mainnet.json .fleek.json
- name: Deploy fleek
id: deploy
uses: fleekhq/action-deploy@v1
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
- name: upload sourcemap to apm
env:
COMMIT_SHA: ${{ github.sha }}
run: |
for f in $(find ./build/static/ -name *.js.map) ; do
curl -X POST "https://kibana-sourcemaps.aragon.org/api/apm/sourcemaps" \
-H 'Content-Type: multipart/form-data' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${{ secrets.APM_API_KEY }}' \
-F service_name="court" \
-F service_version="$COMMIT_SHA" \
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \
-F sourcemap=@$f
done
build-deploy-develop:
runs-on: ubuntu-latest
container: fleek/create-react-app:node-15
if: github.ref == 'refs/heads/develop'
strategy:
matrix:
environment: ["STAGING"]
include:
- environment: "STAGING"
fleekfile: "staging.json"
environment_name: "staging"
subgraph_name: "staging"
environment: ${{ matrix.environment }}
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14
- name: install dependencies
run: yarn install
- name: lint
run: yarn lint
- name: build app
env:
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }}
REACT_APP_DEPLOY_VERSION: ${{ github.sha }}
REACT_APP_DEPLOY_ENVIRONMENT: ${{ matrix.environment_name }}
REACT_APP_CHAIN_ID: 4
REACT_APP_ETHERSCAN_ENDPOINT: ${{ secrets.REACT_APP_ETHERSCAN_ENDPOINT }}
REACT_APP_SUBGRAPH_NAME: ${{ matrix.subgraph_name }}
run: yarn build
- name: Activate fleek
env:
FLEEK_FILE: ${{ matrix.fleekfile }}
run: mv .github/fleek/$FLEEK_FILE .fleek.json
- name: Deploy fleek
id: deploy
uses: fleekhq/action-deploy@v1
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
- name: upload sourcemap to apm
env:
COMMIT_SHA: ${{ github.sha }}
run: |
for f in $(find ./build/static/ -name *.js.map) ; do
curl -X POST "https://kibana-sourcemaps.aragon.org/api/apm/sourcemaps" \
-H 'Content-Type: multipart/form-data' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${{ secrets.APM_API_KEY }}' \
-F service_name="court" \
-F service_version="$COMMIT_SHA" \
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \
-F sourcemap=@$f
done
build-deploy-testing-deployment:
runs-on: ubuntu-20.04
container: fleek/create-react-app:node-15
if: github.ref == 'refs/heads/testing-deployment'
strategy:
matrix:
environment: ["RINKEBY", "STAGING"]
include:
- environment: "RINKEBY"
fleekfile: "rinkeby.json"
environment_name: "rinkeby"
subgraph_name: ""
- environment: "STAGING"
fleekfile: "staging.json"
environment_name: "staging"
subgraph_name: "staging"
environment: ${{ matrix.environment }}
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14
- name: install dependencies
run: yarn install
- name: lint
run: yarn lint
- name: build app
env:
REACT_APP_ANALYTICS_KEY: ${{ secrets.REACT_APP_ANALYTICS_KEY }}
REACT_APP_DEPLOY_VERSION: ${{ github.sha }}
REACT_APP_DEPLOY_ENVIRONMENT: ${{ matrix.environment_name }}
REACT_APP_CHAIN_ID: 4
REACT_APP_ETHERSCAN_ENDPOINT: ${{ secrets.REACT_APP_ETHERSCAN_ENDPOINT }}
REACT_APP_SUBGRAPH_NAME: ${{ matrix.subgraph_name }}
run: yarn build
- name: Activate fleek
env:
FLEEK_FILE: ${{ matrix.fleekfile }}
run: mv .github/fleek/$FLEEK_FILE .fleek.json
- name: Deploy fleek
id: deploy
uses: fleekhq/action-deploy@v1
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
- name: upload sourcemap to apm
env:
COMMIT_SHA: ${{ github.sha }}
run: |
for f in $(find ./build/static/ -name *.js.map) ; do
curl -X POST "https://kibana-sourcemaps.aragon.org/api/apm/sourcemaps" \
-H 'Content-Type: multipart/form-data' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${{ secrets.APM_API_KEY }}' \
-F service_name="court" \
-F service_version="$COMMIT_SHA" \
-F bundle_filepath="http://localhost/static/js/$(basename $f)" \
-F sourcemap=@$f
done