Skip to content

Commit

Permalink
Merge pull request #122 from creativecommons/refine-automation
Browse files Browse the repository at this point in the history
Merge refine-automation branch into gsoc2024-dev-1 branch
  • Loading branch information
naishasinha authored Aug 12, 2024
2 parents c25d060 + 852aa0d commit d70e7f2
Show file tree
Hide file tree
Showing 29 changed files with 1,528 additions and 666 deletions.
30 changes: 3 additions & 27 deletions .github/workflows/fetch.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
name: Fetch Data

on:
push:
# push:
schedule:
- cron: '15 1 1-20 1,4,7,10 *'
- cron: '15 5 1-20 1,4,7,10 *'
- cron: '15 9 1-20 1,4,7,10 *'
- cron: '15 13 1-20 1,4,7,10 *'
- cron: '15 17 1-20 1,4,7,10 *'
- cron: '15 21 1-20 1,4,7,10 *'
- cron: '15 23 1-20 1,4,7,10 *'
# 1:15am onwards, days 1-20, first month of each quarter
- cron: '15 1,5,9,13,17,21,23 1-20 1,4,7,10 *'
workflow_dispatch:

jobs:
Expand All @@ -34,29 +29,10 @@ jobs:
pip install --upgrade pip
pip install pipenv
pipenv sync --system
pip install -r requirements.txt
- name: Set PYTHONPATH
run: echo "PYTHONPATH=./scripts" >> $GITHUB_ENV

- name: Run fetch script
run: |
python scripts/1-fetch/gcs_fetched.py
- name: Fetch and merge changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation fetch_and_merge --branch fetch-automation
- name: Add and commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation add_and_commit --message "Automated data fetch and commit"
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation push
28 changes: 2 additions & 26 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ name: Process Data
on:
# push:
schedule:
- cron: '15 1 1-20 1,4,7,10 *'
- cron: '15 5 1-20 1,4,7,10 *'
- cron: '15 9 1-20 1,4,7,10 *'
- cron: '15 13 1-20 1,4,7,10 *'
- cron: '15 17 1-20 1,4,7,10 *'
- cron: '15 21 1-20 1,4,7,10 *'
- cron: '15 23 1-20 1,4,7,10 *'
# 1:15am onwards, days 1-20, second month of each quarter
- cron: '15 1,5,9,13,17,21,23 1-20 2,5,8,11 *'
workflow_dispatch:

jobs:
Expand All @@ -30,29 +25,10 @@ jobs:
pip install --upgrade pip
pip install pipenv
pipenv sync --system
pip install -r requirements.txt
- name: Set PYTHONPATH
run: echo "PYTHONPATH=./scripts" >> $GITHUB_ENV

- name: Run process script
run: |
python scripts/2-process/gcs_processed.py
- name: Fetch and merge changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation fetch_and_merge --branch fetch-automation
- name: Add and commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation add_and_commit --message "Automated data processing and commit"
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation push
29 changes: 3 additions & 26 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ name: Generate Report
on:
push:
schedule:
- cron: '15 1 1-20 1,4,7,10 *'
- cron: '15 5 1-20 1,4,7,10 *'
- cron: '15 9 1-20 1,4,7,10 *'
- cron: '15 13 1-20 1,4,7,10 *'
- cron: '15 17 1-20 1,4,7,10 *'
- cron: '15 21 1-20 1,4,7,10 *'
- cron: '15 23 1-20 1,4,7,10 *'
# 1:15am onwards, days 1-20, third month of each quarter
- cron: '15 1,5,9,13,17,21,23 1-20 3,6,9,12 *'
workflow_dispatch:


jobs:
generate-report:
runs-on: ubuntu-latest
Expand All @@ -30,29 +26,10 @@ jobs:
pip install --upgrade pip
pip install pipenv
pipenv sync --system
pip install -r requirements.txt
- name: Set PYTHONPATH
run: echo "PYTHONPATH=./scripts" >> $GITHUB_ENV

- name: Run report script
run: |
python scripts/3-report/gcs_reports.py
- name: Fetch and merge changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation fetch_and_merge --branch fetch-automation
- name: Add and commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation add_and_commit --message "Automated data report and commit"
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/shared.py --operation push
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name = "pypi"

[packages]
flickrapi = "*"
GitPython = "*"
google-api-python-client = "*"
internetarchive = "*"
jupyterlab = ">=3.6.7"
Expand Down
Loading

0 comments on commit d70e7f2

Please sign in to comment.