Skip to content

Daily Extraction Schedule #14

Daily Extraction Schedule

Daily Extraction Schedule #14

name: Daily Extraction Schedule
on:
schedule:
# Run the workflow every day at 6 AM UTC
- cron: "0 6 * * *"
workflow_dispatch:
jobs:
extract:
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.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make init
- name: Create credentials.json
run: |
echo '${{ secrets.CREDENTIALS }}' > credentials.json
- name: Verify credentials
run: |
if [ -f credentials.json ]; then
echo "Credentials file exists."
else
echo "Credentials file not found."
exit 1
fi
- name: Run Python script
id: generate-log
run: |
LOG_FILE="extraction-log-$(date +%Y-%m-%d).txt"
make run > "$LOG_FILE"
echo "Log saved to $LOG_FILE"
echo "LOG_FILE=$LOG_FILE" >> "$GITHUB_OUTPUT"
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
- name: Clean up credentials.json
run: rm -f credentials.json
- name: Upload log file
uses: actions/upload-artifact@v4
with:
name: extraction-log
path: ${{ steps.generate-log.outputs.LOG_FILE }}