Gather data #32
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: Gather data | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Generate the input CSV file from a fresh Majestic CSV file | |
run: | | |
wget http://downloads.majestic.com/majestic_million.csv | |
cat majestic_million.csv | awk -F "," 'NR>1 {print $1 "," $3}' > data/input.csv | |
rm majestic_million.csv | |
- name: Run data gathering script | |
run: | | |
cd scripts; python gather_data.py | |
ls -l --block-size=M ../data/data.db | |
- name: Set up Git user | |
run: git config --global user.email "[email protected]"; git config --global user.name "GHActionBot" | |
- name: Commit update | |
run: git commit -am "Sync data DB and corresponding input CSV file"; git push |