forked from Rockytkg/AutoMoGuDingCheckIn
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
75d81ad
commit 2d1e14c
Showing
1 changed file
with
56 additions
and
56 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 |
---|---|---|
@@ -1,65 +1,65 @@ | ||
# name: "打卡" | ||
name: "打卡" | ||
|
||
# # 明确触发条件 | ||
# on: | ||
# workflow_dispatch: # 手动触发 | ||
# schedule: | ||
# # 使用 UTC 时间,UTC 时间 对应 北京时间 -8 小时 | ||
# - cron: "30 0 * * *" # UTC 01:00 / 北京时间 06:00 | ||
# - cron: "45 0 * * *" # UTC 01:00 / 北京时间 07:00 | ||
# - cron: "0 1 * * *" # UTC 00:00 / 北京时间 08:00 | ||
# - cron: "0 9 * * *" # UTC 09:00 / 北京时间 17:00 | ||
# 明确触发条件 | ||
on: | ||
workflow_dispatch: # 手动触发 | ||
schedule: | ||
# 使用 UTC 时间,UTC 时间 对应 北京时间 -8 小时 | ||
- cron: "30 0 * * *" # UTC 01:00 / 北京时间 08:30 | ||
- cron: "45 0 * * *" # UTC 01:00 / 北京时间 08:45 | ||
- cron: "0 1 * * *" # UTC 00:00 / 北京时间 09:00 | ||
- cron: "0 9 * * *" # UTC 09:00 / 北京时间 17:00 | ||
|
||
# # 配置并发控制,避免任务重叠执行 | ||
# concurrency: | ||
# group: ${{ github.workflow }}-${{ github.ref }} | ||
# cancel-in-progress: true | ||
# 配置并发控制,避免任务重叠执行 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 10 # 添加超时限制 | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 # 添加超时限制 | ||
|
||
# steps: | ||
# # 设置时区为 Asia/Shanghai | ||
# - name: Set timezone | ||
# uses: szenius/[email protected] | ||
# with: | ||
# timezoneLinux: "Asia/Shanghai" | ||
steps: | ||
# 设置时区为 Asia/Shanghai | ||
- name: Set timezone | ||
uses: szenius/[email protected] | ||
with: | ||
timezoneLinux: "Asia/Shanghai" | ||
|
||
# # 检出代码仓库 | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 1 # 优化克隆深度 | ||
# 检出代码仓库 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 # 优化克隆深度 | ||
|
||
# # 设置 Python 环境 | ||
# - name: Set up Python | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: '3.10' | ||
# cache: 'pip' # 启用 pip 缓存 | ||
# check-latest: true # 检查是否有更新的补丁版本 | ||
# 设置 Python 环境 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' # 启用 pip 缓存 | ||
check-latest: true # 检查是否有更新的补丁版本 | ||
|
||
# # 缓存 pip 依赖 | ||
# - name: Cache pip packages | ||
# uses: actions/cache@v4 | ||
# with: | ||
# path: ~/.cache/pip | ||
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-pip- | ||
# 缓存 pip 依赖 | ||
- name: Cache pip packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
# # 安装依赖 | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install -r requirements.txt | ||
# 安装依赖 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# # 执行任务 | ||
# - name: Run sign in script | ||
# env: | ||
# USER: ${{ secrets.USER }} | ||
# TZ: Asia/Shanghai # 确保脚本运行时也使用正确的时区 | ||
# run: | | ||
# python main.py | ||
# 执行任务 | ||
- name: Run sign in script | ||
env: | ||
USER: ${{ secrets.USER }} | ||
TZ: Asia/Shanghai # 确保脚本运行时也使用正确的时区 | ||
run: | | ||
python main.py |