-
Notifications
You must be signed in to change notification settings - Fork 277
49 lines (42 loc) · 1.39 KB
/
cron_bypassCF.yaml
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: bypassCF cron
on:
schedule:
# 每天 UTC 时间 18:00 运行
- cron: "0 18 * * *"
workflow_dispatch: # 允许手动触发
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20 # 设置作业超时时间为20分钟
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3 # 检出仓库
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install
sudo apt install -y xvfb
- name: Load environment variables
id: load-env
run: |
if [ -z "${{ secrets.USERNAMES }}" ] || [ "${{ secrets.USERNAMES }}" == "" ]; then
echo "Loading environment variables from .env file"
set -a
source .env
set +a
echo "USERNAMES=${USERNAMES}" >> $GITHUB_ENV
echo "PASSWORDS=${PASSWORDS}" >> $GITHUB_ENV
echo "WEBSITE=${WEBSITE}" >> $GITHUB_ENV
else
echo "Using secrets"
echo "USERNAMES=${{ secrets.USERNAMES }}" >> $GITHUB_ENV
echo "PASSWORDS=${{ secrets.PASSWORDS }}" >> $GITHUB_ENV
echo "WEBSITE=${{ secrets.WEBSITE }}" >> $GITHUB_ENV
fi
- name: Run a script
run: xvfb-run node bypasscf.js