-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.51 KB
/
rss_generator.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
name: Generate RSS Feed
on:
push:
branches:
- master # 或你想要的分支
paths:
- '.github/workflows/rss_generator.yml'
- 'rss_generator.py'
- 'config.yaml'
schedule:
- cron: '0 0 * * *' # 每天运行一次
workflow_dispatch: # 允许手动触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # 或其他你需要的版本
- name: Install dependencies
run: |
sudo apt-get install -y chromium-browser
pip install -r requirements.txt # 确保requirements.txt包含selenium和其他依赖
- name: Run RSS generator
env:
DISPLAY: ':99' # 设置无头浏览器显示
run: |
Xvfb :99 -ac &
python rss_generator.py # 运行你的Python脚本
- name: Download Microsoft Research Feed
run: |
curl -o rss/MicrosoftResearch.xml https://www.microsoft.com/en-us/research/feed/
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用GITHUB_TOKEN
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add rss/*
git commit -m "Update RSS feeds"
git remote set-url --push origin https://xxcdd:[email protected]/xxcdd/web2rss
git push origin master