Skip to content

refresh-news

refresh-news #239

Workflow file for this run

name: refresh-news
# 15-minute Dubai news refresh — Vercel Hobby plan only permits a daily
# cron, so we run the schedule on GitHub Actions instead. The action pings
# /api/cron/refresh, which proxy.ts gates with CRON_SECRET.
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch: # allow manual fire from the Actions tab
concurrency:
group: refresh-news
cancel-in-progress: false
jobs:
ping:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Hit /api/cron/refresh
env:
DEPLOY_URL: ${{ secrets.DEPLOY_URL }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
run: |
if [ -z "$DEPLOY_URL" ] || [ -z "$CRON_SECRET" ]; then
echo "::error::DEPLOY_URL or CRON_SECRET is missing in repo secrets"
exit 1
fi
code=$(curl -sS -o /tmp/body -w "%{http_code}" -m 60 \
-H "Authorization: Bearer $CRON_SECRET" \
"$DEPLOY_URL/api/cron/refresh")
echo "Status: $code"
cat /tmp/body
test "$code" = "200"