-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.38 KB
/
scheduled_extraction.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 }}