fraud-detection-mlops-api / .github /workflows /keepalive-hf-space.yml
github-actions[bot]
deploy: sync snapshot from github
4937cba
raw
history blame contribute delete
843 Bytes
name: Keep HF Space Warm
on:
schedule:
# Monday, Wednesday, Friday at 09:00 UTC
- cron: "0 9 * * 1,3,5"
workflow_dispatch:
jobs:
ping:
runs-on: ubuntu-latest
steps:
- name: Validate HF Space URL secret
env:
HF_SPACE_URL: ${{ secrets.HF_SPACE_URL }}
run: |
if [ -z "$HF_SPACE_URL" ]; then
echo "HF_SPACE_URL secret is not set."
exit 1
fi
- name: Ping health endpoint
env:
HF_SPACE_URL: ${{ secrets.HF_SPACE_URL }}
run: |
set -e
curl -fsS --retry 3 --retry-delay 5 "$HF_SPACE_URL/health"
- name: Ping metrics endpoint
env:
HF_SPACE_URL: ${{ secrets.HF_SPACE_URL }}
run: |
set -e
curl -fsS --retry 3 --retry-delay 5 "$HF_SPACE_URL/metrics"