HF Space KeepAlive Simple #271
This file contains hidden or 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: HF Space KeepAlive Simple | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 1 * * *" | |
| - cron: "0 7 * * *" | |
| - cron: "13 13 * * *" | |
| jobs: | |
| keepalive: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 6 | |
| env: | |
| SPACE_URL: "https://huggingface.co/spaces/xiajingfeng/shufa" | |
| steps: | |
| - name: 单次访问保活,忽略请求失败 | |
| run: | | |
| echo "发起第一次访问" | |
| curl -L \ | |
| -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/125.0.0.0 Safari/537.36" \ | |
| --connect-timeout 25 \ | |
| --max-time 50 \ | |
| "$SPACE_URL" || true | |
| sleep 12 | |
| echo "发起第二次访问" | |
| curl -L \ | |
| -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/125.0.0.0 Safari/537.36" \ | |
| --connect-timeout 25 \ | |
| --max-time 50 \ | |
| "$SPACE_URL" || true | |
| echo "所有保活请求执行完毕,流程正常结束" |