From 2d1e14c24155e80d86a76a4e02bde9f4d394c402 Mon Sep 17 00:00:00 2001 From: Harry-Mathematics <2718818584@qq.com> Date: Tue, 4 Feb 2025 18:25:46 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 112 ++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e8cbef..65d2dc5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/set-timezone@v2.0 -# with: -# timezoneLinux: "Asia/Shanghai" + steps: + # 设置时区为 Asia/Shanghai + - name: Set timezone + uses: szenius/set-timezone@v2.0 + 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