-
Notifications
You must be signed in to change notification settings - Fork 13
174 lines (157 loc) · 6.45 KB
/
pull-data.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
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: Pull Data
on:
schedule:
- cron: "0 10 * * *"
workflow_dispatch:
inputs:
choice:
type: choice
description: Select fetch type
options:
- reduced
- full
default: full
jobs:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- run: npm install
- name: Pull Proposals
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
SNAPSHOT_API_KEY: ${{ secrets.SNAPSHOT_API_KEY }}
run: |
npx ts-node ./src/export-proposals.ts
npx ts-node ./src/upload.ts Proposals ./public/proposals.csv
- name: Pull Votes
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
SNAPSHOT_API_KEY: ${{ secrets.SNAPSHOT_API_KEY }}
run: |
npx ts-node ./src/export-votes.ts
npx ts-node ./src/upload.ts Votes ./public/votes.csv
- name: Pull Balances
env:
COVALENTHQ_API_KEY: ${{ secrets.COVALENTHQ_API_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
run: |
npx ts-node ./src/export-balances.ts
npx ts-node ./src/upload.ts Balances ./public/balances.csv
npx ts-node ./src/upload.ts BalanceHistory ./public/balances.csv --append
- name: Pull Grants
env:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
COVALENTHQ_API_KEY: ${{ secrets.COVALENTHQ_API_KEY }}
INFURA_URL: ${{ secrets.INFURA_URL }}
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
run: |
npx ts-node ./src/export-grants.ts
npx ts-node ./src/upload.ts Grants ./public/grants.csv
npx ts-node ./src/upload.ts Vestings ./public/vestings.csv
- name: Pull Transactions
env:
COVALENTHQ_API_KEY: ${{ secrets.COVALENTHQ_API_KEY }}
DECENTRALAND_DATA_URL: https://data.decentraland.vote/
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: |
npx ts-node ./src/export-transactions.ts --${{ github.event.inputs.choice }}
npx ts-node ./src/upload.ts Transactions ./public/transactions.csv
- name: Pull Collections
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: |
npx ts-node ./src/export-collections.ts
npx ts-node ./src/upload.ts Collections ./public/collections.csv
- name: Pull Wearables
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: |
npx ts-node ./src/export-wearables.ts
npx ts-node ./src/upload.ts Wearables ./public/wearables.csv
- name: Pull Curations
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: |
npx ts-node ./src/export-curations.ts
npx ts-node ./src/upload.ts Curations ./public/curations.csv
- name: Pull Members
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
SNAPSHOT_API_KEY: ${{ secrets.SNAPSHOT_API_KEY }}
run: |
npx ts-node ./src/export-members.ts
npx ts-node ./src/upload.ts Members ./public/members.csv
- name: Export KPIs
env:
NODE_OPTIONS: "--max-old-space-size=8192"
SHEET_ID: ${{ secrets.SHEET_ID }}
SHEET_CLIENT_EMAIL: ${{ secrets.SHEET_CLIENT_EMAIL }}
SHEET_PRIVATE_KEY: ${{ secrets.SHEET_PRIVATE_KEY }}
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: |
npx ts-node ./src/export-kpis.ts
npx ts-node ./src/upload.ts KPIs ./public/kpis.json
- name: Export API
env:
NODE_OPTIONS: "--max-old-space-size=8192"
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: npx ts-node ./src/export-api.ts
- name: Export Report
env:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: npx ts-node ./src/export-report.ts
- name: Export Budgets
env:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}
run: npx ts-node ./src/export-budgets.ts
- name: Remove transactions.json & transactions.csv
run: |
if [ -f ./public/transactions.json ]; then
rm ./public/transactions.json
echo "transactions.json successfully removed."
else
echo "The file transactions.json does not exist in the ./public directory."
fi
if [ -f ./public/transactions.csv ]; then
rm ./public/transactions.csv
echo "transactions.csv successfully removed."
else
echo "The file transactions.csv does not exist in the ./public directory."
fi
- name: Deploy 🚀
if: ${{ !cancelled() }}
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: public