-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Scheduled Node.js CI | ||
|
||
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] # 选择你需要的 Node.js 版本 | ||
env: | ||
# 在作业级别设置环境变量 | ||
USERNAMES: ${{ secrets.USERNAMES }} | ||
PASSWORDS: ${{ secrets.PASSWORDS }} | ||
|
||
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: Start Xvfb | ||
run: | | ||
# 启动 Xvfb 在 Display :99 | ||
sudo Xvfb :99 & | ||
export DISPLAY=:99 | ||
- name: Run a script | ||
run: node pteer.js # 替换为你想运行的脚本的实际名称 |
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
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