-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (118 loc) · 4.7 KB
/
fetchRss.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: 抓取並上傳 RSS
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/*'
- 'code/*'
# - '*.rss'
- '*'
- '**'
schedule:
- cron: '*/5 * * * *' # 每隔 5 分鐘運行一次
- cron: '*/10 * * * *' # 每隔 10 分鐘運行一次
- cron: '*/15 * * * *' # 每隔 15 分鐘運行一次
- cron: '*/20 * * * *' # 每隔 20 分鐘運行一次
- cron: '*/25 * * * *' # 每隔 25 分鐘運行一次
- cron: '*/30 * * * *' # 每隔 30 分鐘運行一次
jobs:
deploy:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: 檢出代碼
timeout-minutes: 2
uses: actions/checkout@v4
- name: 檢出代碼 2
timeout-minutes: 2
run: |
echo 1
for i in {1..100}; do git pull && break; done
echo 2
- name: Install and configure Cloudflare WARP
timeout-minutes: 2
run: |
echo 1
for i in {1..10}; do curl -v https://1.1.1.1/cdn-cgi/trace && break; done
echo 2
for i in {1..10}; do curl https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg && break; done
echo 3
for i in {1..10}; do echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list && break; done
echo 4
for i in {1..10}; do sudo apt update -y && break; done
echo 5
for i in {1..10}; do sudo apt install -y cloudflare-warp && break; done
echo 6
for i in {1..10}; do warp-cli --accept-tos registration new && break; done
echo 7
for i in {1..10}; do warp-cli --accept-tos mode warp+doh && break; done
echo 8
for i in {1..10}; do warp-cli --accept-tos tunnel ip add 127.0.0.1 && break; done
echo 9
for i in {1..10}; do warp-cli --accept-tos tunnel host add localhost && break; done
echo 10
for i in {1..10}; do warp-cli --accept-tos connect && break; done
echo 11
- name: Testing WARP
timeout-minutes: 2
run: |
echo 1
while ! curl -s https://1.1.1.1/cdn-cgi/trace | grep -q "warp=on"; do echo "warp is off, retrying..."; sleep 1; done; echo "warp is on"
echo 2
while ! curl -s https://mozilla.cloudflare-dns.com/cdn-cgi/trace | grep -q "warp=on"; do echo "warp is off, retrying..."; sleep 1; done; echo "warp is on"
echo 3
warp-cli --accept-tos tunnel stats
echo 4
warp-cli --accept-tos --help
echo 5
warp-cli --accept-tos settings | grep protocol
echo 6
warp-cli --accept-tos settings
echo 7
warp-cli --accept-tos tunnel protocol set MASQUE
echo 8
warp-cli --accept-tos settings | grep protocol
echo 9
for i in {1..10}; do curl -s curl -v https://images.weserv.nl/quota && break; done
echo 10
for i in {1..10}; do curl -s curl -v https://wsrv.nl/quota && break; done
echo 11
for i in {1..10}; do curl -s https://github.com/raileo98/test2/raw/refs/heads/main/hk_rthk_ch.xml | head -n 10 && break; done
echo 12
for i in {1..10}; do curl -s https://raw.githubusercontent.com/raileo98/test2/refs/heads/main/hk_rthk_ch.xml | head -n 10 && break; done
echo 13
- name: 檢出代碼 3
timeout-minutes: 2
run: |
echo 1
for i in {1..100}; do git pull && break; done
echo 2
- name: 安裝依賴
timeout-minutes: 2
run: |
for i in {1..10}; do sudo apt update -y && break; done
for i in {1..10}; do sudo apt install python3 python3-pip redis-server -y && break; done
for i in {1..10}; do sudo python3 -m pip install --upgrade -r requirements.txt && break; done
for i in {1..10}; do sudo systemctl status redis && break; done
for i in {1..10}; do sudo systemctl enable redis && break; done
for i in {1..10}; do sudo systemctl start redis && break; done
for i in {1..10}; do sudo systemctl status redis && break; done
- name: 執行 Python 腳本
timeout-minutes: 10
run: |
echo 1
python3 code/rthk.py
echo 2
- name: Redis 狀態
run: |
for i in {1..10}; do sudo systemctl status redis && break; done
- name: 上傳 RSS 文件
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions"
git add *.xml
echo '# git stash'
git commit -m "Upload RSS file"
git push origin main