Merge pull request #121 from creativecommons/fetch-automation #8
Workflow file for this run
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: 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 *' | |
workflow_dispatch: | |
jobs: | |
generate-report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
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 |