Skip to content

Convert Back-end Airtable to CSV file #40

Convert Back-end Airtable to CSV file

Convert Back-end Airtable to CSV file #40

name: Convert Back-end Airtable to CSV file
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
jobs:
convert-airtable-to-csv:
runs-on: ubuntu-latest
steps:
- name: Checkout persist credentials
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # [email protected]
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Install dependencies
run:
pip install airtable-python-wrapper
- name: Convert to backend of Airtable to CSV
env:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
AIRTABLE_BASE_ID: 'appgxpCzCDNyGjWc8'
AIRTABLE_TABLE_NAME: 'tblZGe2a2XeBxrEHP'
run: |
python .github/scripts/convert_airtable_to_csv.py $AIRTABLE_API_KEY $AIRTABLE_BASE_ID $AIRTABLE_TABLE_NAME
ls ersilia/hub/content/data/*
wc -l ersilia/hub/content/data/models.tsv
git status
- name: Commit and push changes done to the table CSV
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 # [email protected]
with:
author_name: "ersilia-bot"
author_email: "[email protected]"
message: "update airtable csv [skip ci]"
repository: "ersilia-os/${{ github.event.repository.name }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
amend: true
force: true
branch: "master"