This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
compute-markets-emissions #368
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: compute-markets-emissions | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '1 14 * * *' | |
push: | |
branches: | |
- feat/revamp-markets-emission | |
env: | |
RPC_URL: ${{ secrets.RPC_URL }} | |
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} | |
PINATA_JWT_KEY: ${{ secrets.PINATA_JWT_KEY }} | |
jobs: | |
compute-markets-emissions: | |
name: Compute markets emissions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate a token | |
id: generate-token | |
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Compute Market Distribution | |
run: yarn markets:emissions | |
- name: Update subgraph distributions | |
run: yarn markets:emissions:subgraph | |
- name: Commit and push if there are changes | |
run: | | |
git add distribution | |
if [[ -z $(git status -s) ]] | |
then | |
echo "tree is clean" | |
else | |
git config --global user.name 'Distributor bot' | |
git config --global user.email '[email protected]' | |
git commit -am "feat: compute market distribution from CI" | |
git push | |
exit | |
fi |