-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.34 KB
/
Copy pathfetch.yml
File metadata and controls
49 lines (42 loc) · 1.34 KB
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
name: AI Content Fetcher
on:
# Sydney/Australia timezone: AEDT (UTC+11) Oct-Apr, AEST (UTC+10) Apr-Oct
# Run at 9:00am Sydney time
schedule:
- cron: "0 22 * 10-12,1-3 *" # 22:00 UTC = 9:00am AEDT (Sydney summer, Oct-Mar)
- cron: "0 23 * 4-9 *" # 23:00 UTC = 9:00am AEST (Sydney winter, Apr-Sep)
workflow_dispatch:
inputs:
dry_run:
description: "Only print; do not write to Notion"
type: boolean
default: false
concurrency:
group: ai-content-fetcher
cancel-in-progress: true
jobs:
fetch:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run AI Content Fetcher
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_DB_ID: ${{ secrets.NOTION_DB_ID }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
run: |
if [ "${{ inputs.dry_run }}" = "true" ]; then
python fetch_ai_news.py --dry-run
else
python fetch_ai_news.py
fi