Generate Datasets (Weekly Cron Job) #110
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: Generate Datasets (Weekly Cron Job) | |
on: | |
# A new interval every Sunday (midnight) | |
schedule: | |
- cron: 0 0 * * 0 # 00:00 UTC | |
push: | |
branches: | |
# Allows us to test this workflow | |
- "generate-datasets-trigger-*" | |
jobs: | |
citizens: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/citizens/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/citizens/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- name: Build | |
run: npm run build | |
# 1. Generate Citizen Data CSV 🧮 | |
- run: npm run generate-1-csv | |
# 2. Generate Citizen Data JSON 🧮 | |
- run: npm run generate-2-json | |
# 3. Generate Historical Citizen Voting Escrow Data CSVs 🧮 | |
- run: npm run generate-3-voting-escrow | |
# 4. Generate Citizen Count CSV 🧮 | |
- run: npm run generate-4-count | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '🛂 generate citizens datasets' | |
- name: Push Changes | |
run: git push | |
coordinape: | |
needs: citizens | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/coordinape/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/coordinape/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '🐒 generate coordinape dataset' | |
- name: Push Changes | |
run: git push | |
github: | |
needs: coordinape | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/github/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/github/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate-csv | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '💻 generate github dataset' | |
- name: Push Changes | |
run: git push | |
discourse: | |
needs: github | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/discourse/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/discourse/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate-csv | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '🗳️ generate discourse dataset' | |
- name: Push Changes | |
run: git push | |
discord: | |
needs: discourse | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/discord/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/discord/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate-csv | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '💬 generate discord dataset' | |
- name: Push Changes | |
run: git push | |
snapshot: | |
needs: discord | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/snapshot/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/snapshot/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '🗳️ generate snapshot datasets' | |
- name: Push Changes | |
run: git push | |
sourcecred: | |
needs: snapshot | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/sourcecred/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/sourcecred/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '🛞 generate sourcecred datasets' | |
- name: Push Changes | |
run: git push | |
dework: | |
needs: sourcecred | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/dework/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/dework/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '👷 generate dework datasets' | |
- name: Push Changes | |
run: git push | |
karma: | |
needs: dework | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: data-sources/karma/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: data-sources/karma/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '😇 generate karma datasets' | |
- name: Push Changes | |
run: git push | |
nationcred: | |
needs: karma | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: nationcred/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull changes | |
run: | | |
git fetch | |
git pull | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
cache-dependency-path: nationcred/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
- run: npm run build | |
- run: npm run generate | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add output/* | |
git commit --allow-empty -m '🎗️ generate nationcred datasets' | |
- name: Push Changes | |
run: git push | |
- name: Update NationCred smart contract | |
env: | |
CONTRACT_OWNER_PRIVATE_KEY: ${{ secrets.CONTRACT_OWNER_PRIVATE_KEY }} | |
run: npm run update-smart-contract |