Daily Extraction Schedule #9
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: 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 | |
run: make run > log.txt | |
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: logger | |
path: log.txt |