Fetch Coordinape Data (Daily Cron Job) #7
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: Fetch Coordinape Data (Daily Cron Job) | |
on: | |
# A new interval every day (midnight) | |
schedule: | |
- cron: 0 0 * * * # 00:00 UTC | |
push: | |
branches: | |
# Allows us to test this workflow | |
- "fetch-coordinape-data-trigger-*" | |
jobs: | |
development_guild: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: development-guild/contributions/ | |
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: development-guild/contributions/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
# Fetch Coordinape users and store them in a CSV file 🧮 | |
- run: node fetch-users.js | |
# Fetch Coordinape contributions and store them in a CSV file 🧮 | |
- run: node fetch-contributions.js | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add coordinape-users.csv | |
git add coordinape-contributions.csv | |
git commit --allow-empty -m 'fetch coordinape contributions - development guild' | |
- name: Push Changes | |
run: git push | |
ops_guild: | |
needs: development_guild | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ops-guild/contributions/ | |
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: ops-guild/contributions/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
# Fetch Coordinape users and store them in a CSV file 🧮 | |
- run: node fetch-users.js | |
# Fetch Coordinape contributions and store them in a CSV file 🧮 | |
- run: node fetch-contributions.js | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add coordinape-users.csv | |
git add coordinape-contributions.csv | |
git commit --allow-empty -m 'fetch coordinape contributions - ops guild' | |
- name: Push Changes | |
run: git push | |
marketing_guild: | |
needs: ops_guild | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: marketing-guild/contributions/ | |
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: marketing-guild/contributions/package-lock.json | |
- name: Install Node.js Packages 🔧 | |
run: npm install | |
# Fetch Coordinape users and store them in a CSV file 🧮 | |
- run: node fetch-users.js | |
# Fetch Coordinape contributions and store them in a CSV file 🧮 | |
- run: node fetch-contributions.js | |
- name: Commit Changes | |
run: | | |
git config user.name 'NationCred bot' | |
git config user.email '[email protected]' | |
git add coordinape-users.csv | |
git add coordinape-contributions.csv | |
git commit --allow-empty -m 'fetch coordinape contributions - marketing guild' | |
- name: Push Changes | |
run: git push |