readLike(自动阅读随机点赞) #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |