Pull Data #726
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '14' | |
- run: npm install && npm link typescript | |
- 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 |