yale-fortunoff / citationdb-staging

A database for video testimony citations
https://yale-fortunoff.github.io/citationdb-staging/
GNU General Public License v3.0
0 stars 0 forks source link

Changes for auto deploying from Airtable #1

Closed malipetek closed 1 year ago

malipetek commented 1 year ago

Changes

Data

Removed all json data in the src/CitationDB/Data/json/ folder to prevent any confusions. Data will be pulled from airtable when triggered.

Build Setup

There is a github action file in the .github/workflows/build-on-issue.yml. This actions is triggered by issue opening. When there is an issue in this repository, it checks if the title is "build request from airtable" and also makes sure issue is opened by automation. Then takes necessary steps to

Changes

I have removed packages pointed to other projects using bit.dev system. I somewhat understood what that is but I could not figure out how it would work with actions.

Instead github action downloads metadash package before the build and moves component folders into src folder.

So if you download this repository and run build it would not work, you would need to move 4 folder from metadash's src folder to this repositorys srcfolder. This script would do it.

git clone https://github.com/yale-fortunoff/metadash
mv ./metadash/src/FortunoffApp ./src/FortunoffApp
mv ./metadash/src/Inputs ./src/Inputs
mv ./metadash/src/SiteBanner ./src/SiteBanner
mv ./metadash/src/Viz ./src/Viz
rm -rf metadash

Utility scripts

There is 2 utility scripts added. 1 of them require AIRTABLE_TOKEN environment variable to run properly.

download_airtable.js

This script will download all the data from airtable.

convert_airtable_data.js

This script need to run after `download_airtable.js, it converts the json data to format our build / static site requires.