Get API Data From Airtable #521
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: Get API Data From Airtable | |
on: | |
push: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
get_data: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repo | |
- name: Check out code | |
uses: actions/checkout@v3 | |
# Step 2: Install Node.js | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: | | |
npm install | |
# Step 4: Run the script | |
- name: Get API Data | |
run: | | |
export NIGERIAN_BANKS_AIRTABLES="${{ secrets.NIGERIAN_BANKS_AIRTABLES }}" | |
node index.js | |
date > last_updated.txt | |
# Step 5: Push the data | |
- name: Push Data | |
run: | | |
git config --global user.name '${{ github.actor }}' | |
git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
git add -A | |
git commit -am "Fetch New Data" | |
git push |